Jump to content

Post with AJax not getting value


jjmusicpro

Recommended Posts

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.