Probably a dumb question, I'm new to this so please be nice! How would I set a cookie and then redirect to another page. I want to use this for an affiliate website. I put the affiliate code in the form which cookies them, then I want to redirect them to the page with the promo material. How would I do the redirection part in here?? This is what I'm using: <SCRIPT LANGUAGE="JavaScript"> cookie_name = "dataCookie"; var YouEntered; function putCookie() { if(document.cookie != document.cookie) {index = document.cookie.indexOf(cookie_name);} else { index = -1;} if (index == -1) { YouEntered=document.cf.cfd.value; document.cookie=cookie_name+"="+YouEntered+"; expires=Monday, 04-Apr-4000 05:00:00 GMT"; } } </SCRIPT> <FORM NAME="affiliate"> Cookie: <INPUT TYPE="text" NAME="affiliate" size="20"> <INPUT TYPE="button" Value="Set Cookie" onClick="putCookie()"> </FORM> Any help would be great
You should place the code at the end of putCookie, and the code should be something along the lines of: window.location.href = "http://newurl";