atl_andy Posted March 28, 2008 Share Posted March 28, 2008 I have an AJAX script that populates a menu based on the choice of another menu selection. The problem I'm having is the value that is returned to the AJAX menu is the value of my user id, or the session variable of the user that is logged in. I would like to get rid of the isset($_GET['Param']) feature, but the function doesn't work without it. Let me know if more explanation or coade is needed. if( isset($_GET['Param']) ) { AJAX dropdown goes here } The AJAX function that I think is interfering is: function ajaxFunction(ID, Param) { var loaderphp = "<?php echo $_SERVER['PHP_SELF'] ?>"; // Particularly this part...can this be eliminated or changed? xmlHttp.onreadystatechange=function() { if(xmlHttp.readyStae==4) { document.getElementByID(ID).innerHTML = xmlHttp.responseText; } } xmlHttp.open("GET", loaderphp+"?Param="+Param,true); xmlHttp.send(null); } Link to comment https://forums.phpfreaks.com/topic/98313-dynamic-drop-down-problem/ Share on other sites More sharing options...
atl_andy Posted March 28, 2008 Author Share Posted March 28, 2008 Oddly enough, I changed "<?php echo $_SERVER['PHP_SELF'] ?>"; to: "reload.php"; and it worked. I don't know why exactly. If someone can explain, I would be grateful. reload.php is the same script in it's own file. Link to comment https://forums.phpfreaks.com/topic/98313-dynamic-drop-down-problem/#findComment-503087 Share on other sites More sharing options...
AP81 Posted April 2, 2008 Share Posted April 2, 2008 should be: <? echo $PHP_SELF; ?> Link to comment https://forums.phpfreaks.com/topic/98313-dynamic-drop-down-problem/#findComment-507030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.