php - Loading Server Content on Another Window -


i have onclick event designed launch javascript function getdeadlineinfo

function getdeadlineinfo(string)          //string holds name of deadline {     document.location.href='deadlineinfo.htm'; } 

it meant open new page "deadlineinfo.htm". need new page display content server have own function for:

function contactserver(str)                   {     ...additional code here     xmlhttp.open("get","serverscript.php?q="+str,true);     xmlhttp.send(); } 

the problem have no idea how send string variable passed getdeadlineinfo str used sql database. have been googling around , methods i've seen include using along lines of http://www.tek-tips.com/faqs.cfm?fid=5442, doesn't work me if append format document.location.href="deadlineinfo.htm?name="+string;

thanks help!

a couple suggestions.

  1. encode url parameter using encodeuricomponent -> document.location.href="deadlineinfo.htm?name="+encodeuricomponent(string);
  2. change "deadlineinfo.htm" php page -> "deadlineinfo.php" , process name parameter on server using $_get collection
  3. if cannot change page php page, use javascript name function query string.

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -