Jump to content

Ajax multi var


Miko

Recommended Posts

Hello,

 

I'm a total noob if it comes to Ajax and also javascript, so that's why I come here  ::)

 

I have this code:

 

function getSubCat(mainCat)
		{
		   createXMLHttpRequest();
		   var params = "titleid="+mainCat;
		   var params = "main_cat="+mainCat;

		   xmlHttp.open("POST", "getSubCat.php", true);
		   xmlHttp.onreadystatechange = done;
		   xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");   
		   xmlHttp.send(params);
		}

 

code works just fine but it will only take the var "titleid", how can I "post" both vars?

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/171824-ajax-multi-var/
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.