hi,
iam doing a project.
i have a problem that is "how to access PHP variable in Javascript".
techie 0 Newbie Poster
Recommended Answers
Jump to PostThe simplest way is to have php write the info you want into the page as javascript, for ex:
<script type="text/javascript" language="javascript"> <!-- <?php echo("firstVar = $var1;"); echo("2ndVar = $var2;"); ?> // --> </script>
Jump to PostYou just bumped into a 2+ yr old thread !
All 6 Replies
DanceInstructor 19 Posting Whiz
Dukane commented: cool solution +2
hetalsagar 0 Newbie Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster
samina shaikh 0 Newbie Poster
samina shaikh 0 Newbie Poster
Cilice11 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.