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.
- encode url parameter using
encodeuricomponent
->document.location.href="deadlineinfo.htm?name="+encodeuricomponent(string);
- change "deadlineinfo.htm" php page -> "deadlineinfo.php" , process
name
parameter on server using$_get
collection - if cannot change page php page, use javascript
name
function query string.
Comments
Post a Comment