Jump to content

Prompt and send variable


user4fun

Recommended Posts

Here is what i have so far, it needs help, lol you will find the confusing part with //

<script type="text/javascript">function GetInfo(t)  {if t == 0  // this is to prompt user for domain only at the start of the var t if statment  {	  var name=prompt("Please enter your domain","www.YourSite.com")	  if (domain!=null && domain!="")	   {	   document.write("Hello " + domain + "! Thank you for visiting?")		}   }else (t <= 5)	   {  //need help here sending var domain to got_hit.php, this will happen every time	  	   var xmlHttp;		   try			 {		   xmlHttp=new XMLHttpRequest();			 }		   catch (e)		{		   try			 {		   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");			 }		 catch (e)		{		  try			 {		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");			 }		catch (e)			 {		 alert("Your browser does not support AJAX!");		  return false;			 }		   }		   }	xmlHttp.onreadystatechange=function()				 {			 if(xmlHttp.readyState==4) 					  {		picked_file=window.open("http://" + xmlHttp.responseText,"picked_file","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=200");		t++;		setTimeout("picked_file.close(); GetInfo(" + t + ");",9000);		  }		  }				   xmlHttp.open("GET","get_info.php",true);		 xmlHttp.send(null);	 }}</script><body><form name="myForm"><p align="center">Start: <input type="button" onClick="GetInfo(1);" name="start" value="Start" />Stop Demo: <input type="button" onClick="GetInfo(5);" name="stop" value="Stop" /></form> </body></html>

Link to comment
Share on other sites

I Figured it outWOOOOOOOOOHOOOOOOOOOOOOOOOOOOOJust working on syntax issues.foget sending variable to a php file, i am just setting a cookie in javascript and then forceing the page to go to the php file that i want and then asking php to get the cookie value.HAA HA AHA AAHAH AH HA

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...