Jump to content

need help easy to fix im to dum to see it


Recommended Posts

i cant make this work i need to put a cookie in the users computer when they see the flash intro and then redirect them to the home page when they come again.i took this script from the js tutorials and tweeked it to work for me but my tweeking is really lousy i think its a syntax error or somthing help!!!

<html><head><script type="text/javascript">function getCookie(c_name){if (document.cookie.length>0)  {  c_start=document.cookie.indexOf(c_name + "=")  if (c_start!=-1)    {     c_start=c_start + c_name.length+1     c_end=document.cookie.indexOf(";",c_start)    if (c_end==-1) c_end=document.cookie.length    return unescape(document.cookie.substring(c_start,c_end))    }   }return null}function setCookie(c_name,value,expiredays){var exdate=new Date()exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000))document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate)}function checkCookie(){username=getCookie('username')if (username!=null)  {a href="#http://www.w3schools.com"}else   {  username=("youve been here")  if (username!=null||username!="")    {    setCookie('username',username,365)    }  }}</script></head><body onLoad="checkCookie()"></body></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...