jjmusicpro Posted July 21, 2008 Share Posted July 21, 2008 I am trying to do a simple post with ajax to a new page. I checked the values being passed with javascript, and checked the url and it all seems fine however, my ajax page is not picking up the value in the query string. any ideas? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 21, 2008 Share Posted July 21, 2008 Are you using $_GET on the PHP page? >_> Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted July 21, 2008 Author Share Posted July 21, 2008 Yep you bet Ajax Code: JS I see in the alert that it passes the right value, in the url it passes the right value, hower on my ajax page it wont get the value, however it will get value2 that i passed as a test. i tried to do some evalus on the ajax page, but it wont match anything i put, and it should. function showHint(str) { alert(str); var str2 = str; if (str.length==0) { document.getElementById("txtHint").innerHTML="" return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="ajax/gettweek.php" url=url+"?q="+str+"&str2="+str2 url=url+"&sid="+Math.random() alert(url); xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } $q2= $_GET["str2"]; $q = ""; $q = $q2; if ($q = ""){ echo 'Nothing Was Selected.'; } elseif ($q2 == "centeryourprofile"){ } fyi i didnt put all my code for the above, just a snippet, i tried getting the value of q in the url but it wont get it, so i passed another one called q2 and it gets that but, i cant do any evaluations on it, it wont match anything..even though it really does match stuff. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.