JavaScript and Php variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

JavaScript and Php variables

Post 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.
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Solution

Post 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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Search the boards for ActionScript and you may find better solutions.
Post Reply