Jump to content

hansolo

Members
  • Posts

    214
  • Joined

  • Last visited

Everything posted by hansolo

  1. ok thanksso dir name is a built in name..... which finds the path of the file working in ok
  2. do i place ny file name in the directory nameini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log'); do write it like this as in example 1 or as example 2 and add no file name //example 1ini_set('error_log', localhost(file.php) . DIRECTORY_SEPARATOR . 'error.log'); //example 2 ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');
  3. when i have the code in the first error the report says i have a syntax errorParse error: syntax error, unexpected T_IF in C:\wamp\www\name.php on line 15and this line 15 below i cant see any syntax error there ($whatTodo == "submit_name"){ $secondName = "work";$whatTodo = "null";$whatTodo = $_POST["whatTodo"]if($whatTodo == "submit_name"){echo "&secondName"."=".$secondName;}
  4. ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log'); ok how do i write this error log above is that the correct syntax as never hard of a directory seperator (from the php code above) ini_set('error_log', localhost/file.php/ error.log');
  5. how do define my global variable as when i check the php file. keeps returning an error messageIt says the global varaible "whatToDo" is undefined..... //$secondName = "work";$whatTodo = "null";$whatTodo = $_POST['whatTodo']//if($whatTodo == "submit_name"){
  6. send_lv.send("http://localhost/name.php", 0,"POST"); Ok i neede to write send at the end. I id get a returned error on my php statementI am looking into why . The flash now ive wrote the send part as some guy kindly explained.This might work .
  7. as want to keep it simple . Myy question have wrote the syntx correct below . For posting a variable from flash to php. i can load the vairaibles. what am doing wrong on th post side send_lv = new LoadVars();send_lv.boxText,text send_lv("http://localhost/name.php", 0,"POST");
  8. $_POST['whatTodo'] Not using the post correctly in flash and php I have provided a link. As i am unsure what i doing wrong. with the post variables from flash to php I have place a link below which shows the code of both files (actionscript and php. The code i have split into part to show and drwn a border of orange around the first part . Which loading the external varaible of the php file. The loading part works fine. The second part and the third section have border of red and purple . The second p and third part is were its not working. I have submit btn on stage and when the bt is pressed suppose to load the varaible " $secondName"The result is supposed to be shown in the dynamic textbox3 in flash. To check wether global variable of _post was going to work i created an if statment which checked the value of the vairiable in flash "whatoDo" which equal null(nothing). When the submit btn is pressed it gave the value submit_name........ no the method i have above is not neccessary for me to complete . I trying to learn how to ust the post variable to post my results back to php and check this has worked in flash I am just trying to post and check the results. I can load the vairaible . I have attached the code of both files. http://fav.me/d5twxig
  9. I can upload my external variable into flash from a php file. I would like to be able to post the new results back and check the new results are updated. i see we use the loadvars class to upload the results and can see we use the sendvars class to send the new results variables using the post command....... Here comes my questionhow can check these results and also need to be able to set up my php file. i just need to et up a php file cheers so the flash part of the cod will work var result_lv:LoadVars = new LoadVars();result_lv.load ("http://localhost/file.php");result_lv.onLoad = function(success:Boolean) {if (success) {/// i get this how do set textBox.text = result_lv.myName;} else { textBox.text = "Error connecting to server.";}}// will be sending to PHP.btn.onPress = function(){var send_lv:LoadVars = new LoadVars();// Store the values from the textfields in here.send_lv.username = username_txt.text;// Send the variables to your php script using the POST method and// store the results in the result_lv loadVars object.sendLV.send("http://localhost/file.php", "_blank", 'POST')
  10. 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
  11. 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 ....
  12. 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"
  13. 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 "&"
  14. $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 "); }
  15. iv got passed thatissue it was do with no ampersand (&) As i as using load vars so needed to load a string value from the php fie . Howeve i am having an issue when extracting the data from the mysql database. were to place the im ot sure were to place the ampersand onthe following php code below.this what i get when i load the file on localhost . Just not sure how to place the ampersand i when i try to place it near the variable i return nan errorwhat i get from the code below "name=100name=200name=300".// this returns an error$scores.="&$row" .['score'] "&";[AS]$scores ="";while( $row = mysql_fetch_array( $result )){$scores.=$row['score'];}echo $scores[/AS]
  16. // Retrieve all the data "users" table $sql = "SELECT * FROM users"; $result =mysql_query($sql,$connect); // store the record of the "example" table into $row $scores=""; while( $row = mysql_fetch_array( $result )){ $scores='name'."=". $row['score']; echo$scores}?>// here what i get on my out put now i think this value can be read in flash . Have a bit of thought and dedication name=100name=200name=300
  17. How can i convert my database results into a string and store in a variable. I have users table in my database which in the third column are the scores of the users. I have found through help of the forum by making my varaibles in qoutations . i can load my results external. How do change the resutls extracted from a database into a string value. I tried holding the resuts in a varaible called $showReslts how ever this showed an errorAre there any trace command so i can see what is being stored in the viariable $sql = "SELECT * FROM uers"; $result =mysql_query($sql,$connect); // store the record of the "example" table into $row $showscore = ""; while($row = mysql_fetch_array( $result )){ echo $showscore $row['score']; echo"<br/>";
  18. 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]
  19. 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
  20. Ive ried this i thought this string value hat would i write just to print something as simple as my name//$name"my name";print the variables to let flash read themname.= "$name =" "my name";echo $name ;?>
  21. 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.
  22. 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
  23. 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 ;?>
  24. you right i got it working. Its the same as loading a variable from note pad. /* first create a new instance of the LoadVars object */myVars = new LoadVars();// call the load method to load my php page myVars.load("http://localhost/myfile.php");// once vars have been loaded, we will have these variables: myVars.onLoad = function (success) { if (success) {// instant name of text box and the nam of the php variable dynamicTextBox.text = this.nome; // } } else { trace (" Error loading variables "); } } ______________________________________________________________________________________________________The above does work i have better undesrtanding of the loadVars class now . Not perfect but alot more better. I did find the php file though was not read when i did not have the server turned on. Not a an issue as this current time ._____________________________________________________________________________________________________As sephiroth does mention if the file path needs to be a full path as when i tried to place my php and flash file just in folder and my desktop the file was not read As below this was 1 of my errors Another important consideration. When working with php files, if you make a .load calls in flash like this:myVars.load("file.php"); you can't test your movie inside the flash IDE (CTRL+ENTER), this because in this way the php file won't be processed from your webserver and flash will read the source code of the php file, not the expected output!! __________________________________________________________________________________________________I think this saying that php ont be read by flash player when it on a folder on desktop. Not on a serverI did change the path to locate my folder. It only worked through the server in the wamps www folder. However good news is the code is working now and i am loading like an external text file.
×
×
  • Create New...