zyrolasting Posted October 21, 2009 Share Posted October 21, 2009 Hello, hello. I'm trying to wrap my head around AJAX so I can get something working without diving too deeply into PHP's DOM yet. If I were to use the open() method in the XMLHttpRequest object to send a request to the server from JavaScript in the following fashion... XHR.open("GET","../scripts/request.php?type=3",true); How do I access that parameter when I have no implemented function in request.php? Do I just assume a variable called $type is initialized to 3 already and I didn't see it? Link to comment https://forums.phpfreaks.com/topic/178517-parameters-in-ajax/ Share on other sites More sharing options...
Mchl Posted October 21, 2009 Share Posted October 21, 2009 It's $_GET['type']. All parameters passed in url land in $_GET array. Link to comment https://forums.phpfreaks.com/topic/178517-parameters-in-ajax/#findComment-941425 Share on other sites More sharing options...
zyrolasting Posted October 21, 2009 Author Share Posted October 21, 2009 Ah, alright. Perfect. Thank you! Link to comment https://forums.phpfreaks.com/topic/178517-parameters-in-ajax/#findComment-941426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.