View Single Post
Old 12-12-2012, 08:57 PM   PM User | #1
phpchick
New Coder

 
Join Date: May 2011
Location: new york
Posts: 92
Thanks: 4
Thanked 0 Times in 0 Posts
phpchick is an unknown quantity at this point
concatenating multiple variables in a string?

Not sure what the technical term for what I'm doing is but I think I'm trying to concatenate variables into a string.


Code:
xmlhttp.open("GET","http://www.website.com/here.php?q="+str,true);
I had one variable at first, called str. Now I have three more (str2,str3,str4), and I want to assign them each to a GET variable.

What is the proper syntax?

I tried this but it did not work.

xmlhttp.open("GET","http://www.website.com/here.php?q="+str+"&r="+str2+"&s="+str3+"&t="+str4,true);



the URL should look like this
http://www.website.com/here.php?q=st...&t=str3&u=str4
phpchick is offline   Reply With Quote