LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


Prev Previous Post   Next Post Next
  #1  
Old 07-25-2002, 06:32 AM
dv8's Avatar
dv8 dv8 is offline

Admin Mod
 
Join Date: Mar 2001
Posts: 2,053
Rep Power: 15
dv8 is on a distinguished road
Search LoadVars.sendAndLoad w/ PHP FAQs

Quote:
From Thread :http://flashmove.com/board/showthrea...1185#post31185
o yeah dv8 one more request what does the "&" do?? and how come you made it like this when you load it something.userName and the php to &userName=$userName and one more question how do i use flash to send vers to php so it can record it to a txt file since i dunno db files... i'm quite new to this php only been doing it for like a week now so if you find some spare time reply dv8 thanx
-- f5inter
PHP Code:

<?php

    
// Fig 1.1
    
$myVar "FlashMove";
    echo 
"&myVar=$myVar"// Output "&myVar=FlashMove"
?>
In the Fig.1.1, line 2 shows an "&" character. The "&" is an operator to show seperation in variables for the Interpreter. It is not necessary for the first and/or only variable being loaded to the Interpreter, but it is good practice too use.
Once the variables are loaded to the Interpreter and parsed for seperation... the "&" is then ignored.

Let's use a HitCounter as good start on how we can load and send data to and from a Text File.
PHP Code:

    /* Hit Count Script- hit_count.php*/

    
function count_hit () {
        
// Read File
        
$file "temp.txt";
        
$fp fopen($file"r");
        
$reading fread($fp,2000);
        
fclose($fp);
            
        
// Increment
        
$reading++;
        echo 
"&hitcount=$reading";
        
        
// Write File
        
$fp fopen($file"w");
        
$writeing fwrite($fp,$reading);
        
fclose($fp);
    }
    switch (
$action) {
        case 
"countHit":
            
count_hit();
        break;
        default:
            die();
        break;
    } 
Actionscript:
hitCountVar = new LoadVars();
with(hitCountVar) {
	action = "countHit";
	sendAndLoad("hit_count.php", hitCountVar, "GET")
}

hitCountVar.onLoad = function () {
	trace(this.hitcount); // PHP Response
}
.. to be continue
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash MX Mail Form using PHP is driving me crazy! jaguaru Flash MX 2 04-28-2011 03:04 PM
Flash + PHP --> Security !! yestomike Flash MX 2004 2 01-16-2007 07:58 AM
FLASH PHP Submit Form Whit template!! taro Newbies 15 02-15-2006 03:20 PM
LoadVars or XML with PHP on DIFFERENT servers doesn't work. sckz Server Side 4 02-11-2004 04:30 PM
Flash to PHP to MySQL to PHP to Flash gandalf Server Side 8 04-01-2003 10:20 PM




All times are GMT. The time now is 03:59 PM.