Jump to content

Pass php variable to Ajax


alicefreak

Recommended Posts

Hello guys, I want to pass php variable to ajax. My whole script is working correctly.

var age = document.getElementById('$age').value;
queryString = "?age=" + age ;
ajaxRequest.open("GET", "ajax-example.php" + queryString, true);
ajaxRequest.send(null); 

. I know its wrong. Please help.

Thanks

Link to comment
https://forums.phpfreaks.com/topic/214539-pass-php-variable-to-ajax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.