Jump to content

Would like a tutorials on the lower section of this php code.


hansolo

Recommended Posts

Would like to understand the the lower section part of the php code . As this the part which flash is able to read. If follow the link i have placed below. I have outlined the part i like to understand with a red border. ( any tutorials on this lower section of php)thank you http://fav.me/d5rsei0 <?php$nome = "pietro" ;$nick = "lana" ;$mail = "pietro@flash-php.it" ;/*print the variables to the output in order to let flash read them*/$vars = "" ;$vars .= "nome=" . $nome . "&" ;$vars .= "nick=" . $nick . "&" ;$vars .= "mail=" . $mail ;echo $vars ;?>

post-23805-0-77025200-1358452664_thumb.jpg

Link to comment
Share on other sites

My first question in this example The ampersand is that a string value or is that to declare a start of anew variable in this example . As an ampersand used in a text editor does declare a new start of a variable . So flash is able to read the start of a new variable. However the qoutations around the ampersand. It could be possible its a string value. As to my understanding in php when a word has qoutations it is to declare a string

Link to comment
Share on other sites

ok so the ampersand in qoutations if for flash to distinguish the variable from the other variables. As you have explained . So its a similar format to this you tube video . placed below. Does the ampersand need to be within quotations would the value of the ampersand "&" still be read without the qoatations.

Link to comment
Share on other sites

The entire thing needs to be a string. Like I said, Flash expects variables in the same format as they are sent in the URL. The URL to this page contains this: showtopic=46403&pid=258178&st=0 That's the same format Flash would expect, that would define 3 variables and set their values to the various numbers. The entire thing is a string composed of name/value pairs, each separated with an ampersand.

Link to comment
Share on other sites

Ive pasted how far i am. I have the dynamic text box named and all the files in the correct folder. iWhen i am refering to the php variable iside of flash i have an arrow pointing to show were i belive the name goes... pleae see files there are image description to show the part im not fully understanding. http://fav.me/d5su1axhttp://bobafet1000.d...%253A1359245340

Edited by hansolo
Link to comment
Share on other sites

I don't do flash, but I do a lot of AJAX. The process looks similar. If I'm right, your PHP script should NOT contain any HTML tags. There should only be the script, so that it only echoes what you need. With the HTML tags and spaces and newlines, all that is getting sent also.

Link to comment
Share on other sites

I think this is the correct explanation of the below the first part send the varaibe through as a string value to flash. Then concatenationis used to add the value of the name dannny . Thats why its seperated into parts .i am not saying this true but im hoping after all you help ive finally understand why it splits into two parts. thank you for every one help. ( if i have the explanation wrong please tell me other wise im using a method. I dont fully understand . That could lead to issues later on cheers [AS]$firstName = "danny" ; // sending the variable // this sending varaible name(danny)$aVariable = "&firstName=".$firstName; echo $aVariable[/AS]

Edited by hansolo
Link to comment
Share on other sites

$scores ="";while( $row = mysql_fetch_array( $result )){//$scores.=$row['score'];$scores.="&". "=".$row['score'];}echo $scores?>___________________________________________________________________________________ my output now from php below with an ampersand. &=100&=200&=300 ___________________________________________________________________________________ my dynamic table in flash is returned undefined. Not showing the variables // i thought i return the name of the vairiabe below tracing them in flash. returning undefined flash code As2 nameOfText.text = this.scores;trace(_level0.scores);trace(_level0.row); } else { trace (" Error loading variables "); }

Link to comment
Share on other sites

The entire thing needs to be a string. Like I said, Flash expects variables in the same format as they are sent in the URL. The URL to this page contains this: showtopic=46403&pid=258178&st=0 That's the same format Flash would expect, that would define 3 variables and set their values to the various numbers. The entire thing is a string composed of name/value pairs, each separated with an ampersand.
Edited by thescientist
Link to comment
Share on other sites

Thats what i thought i had created here is this not a string .I set the values to variable scores my code$scores.="&". "=".$row['score']; this was my output&=100&=200&=300 this an ampersand i thought "&"

Edited by hansolo
Link to comment
Share on other sites

NAME/value pairs, just like in his example string

The entire thing needs to be a string. Like I said, Flash expects variables in the same format as they are sent in the URL. The URL to this page contains this: showtopic=46403&pid=258178&st=0 That's the same format Flash would expect, that would define 3 variables and set their values to the various numbers. The entire thing is a string composed of name/value pairs, each separated with an ampersand.
you only have values Edited by thescientist
Link to comment
Share on other sites

ok so i missing the the value as have the name when you mention the word "pair" what doe that refer to does that mean two of the same $name = "value"/ would a name value pair be the above wriiten twice. Sorry i know this might seem a silly question. $name = "value" . $name = "value"

Link to comment
Share on other sites

ok ive seen my mistake about time realy sorry for this guys . I know it must be the longest forumIve been placing the dollar sign in front when the ampersand (&) was needed // right there correctecho ("&Name=$Name"); //what i was doing was this i included the dollar sign at twice . That was creating an errorecho ("&$Name=$Name"); but now i still need to get the value included and somehow surrond the whole thing in string. with the mysq as well The above posts ....

Edited by hansolo
Link to comment
Share on other sites

Ive got it now yes . I am only retruning one of the values into flash dynamic textbox. $score = "";while( $row = mysql_fetch_array( $result )){//echo$row['score'];echo "&score". "=".$row['score'];} returns this&score=100&score=200&score=300

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...