Jump to content

pass php variable value?


freaker87

Recommended Posts

I have this code

 

function showprice(str)(str1)
{
if (str=="")
  {
  document.getElementById("txtchem").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtchem").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getchemcom.php?q="+str,true);
xmlhttp.send();

 

 

i use this

<select onchange="showprice(this.value)($amt);" name='fid'>

 

 

then in getchemcom.php file i get value by

$val=$_GET["q"];

 

but its not working plz help me how can i pass $amt value in getchemcom.php page

 

Link to comment
https://forums.phpfreaks.com/topic/255282-pass-php-variable-value/
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.