Using values of variables from php page into javascript page

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
agadgil
Forum Newbie
Posts: 7
Joined: Thu Aug 28, 2003 6:02 am

Using values of variables from php page into javascript page

Post by agadgil »

I am using some variables in my php script, as well I am using these variables in a .js page. Now these variables are not declared in the .js file(hence I get an error whenever my code for php wants to execute such a .js page). The variables are used in the .php file and that I need to use the value of these variables in my .js script. Any idea how I can do this?
User avatar
fallen
Forum Newbie
Posts: 7
Joined: Wed Aug 27, 2003 7:46 am
Location: UK

Post by fallen »

Whats stoping you from delaring them in the php page as in

Code: Select all

some_javascript variable = <?php echo($some_php_variable)?>
Does that help or is that not what you're asking?
Post Reply