Page 1 of 1

JavaScript and Php variables

Posted: Sun Jan 14, 2007 2:55 pm
by user___
Hi guys,
I am working on a project which uses Ajax, pure JavaScript, Php, ActionScript, and others. I have a an ajax script that runs when a user enter a value in a simple textbox in a form. It sends what the user has entered to a .php file which on its own requests an id from a database. After that when a user clicks on some links that have been generated by this .php script there is another ajax which calls a .php file which should (here the problem arose) prints some HTML which displays a .swf file and some JavaScript. The HTML is not the problem so I will not tell more about it but the problem is from the JavaScript. I define two variables which have been got from the last .php file but because they are generated in the middle of the main HTML page they do not correspond to another background JavaScript file which is used to communicate with the ActionScript in the .swf file mentioned above.

My question is whether it is possible to set these variables in Php and if it is how or if there is any way to solve this by JavaScript or any way.

I know that it seems complicated and it really is but I would be really delightful if anyone can help me.

Solution

Posted: Sun Jan 14, 2007 4:45 pm
by user___
I have found a solution. I have created a cookie containing what I need to use in the ActionScript later on. Then I use another .php file which is invoked by ActionScript and then in it I use the cookie(whthat has been already creaed) and send it to ActionScript with another value that has been created in the new.php file.

Posted: Sun Jan 14, 2007 5:08 pm
by Ollie Saunders
Search the boards for ActionScript and you may find better solutions.