Write Cookie

[Total: 0    Average: 0/5]

This will set a cookie that you enter into the form.

Head Code:

<SCRIPT LANGUAGE="JavaScript">

<!-- 
function setCookie(form) {

  cookie_name = "bevo";

             { document.cookie=cookie_name+"="+form.inputbox1.value+"; expires=Tuesday, 01-Apr-2000 08:00:00 GMT; path=/";

      }



  window.alert(form.inputbox1.value)

}

// -->

</SCRIPT>

Body Code:

<center>

<FORM name=cookie-setter>

<table>

<tr>

<td>

Please enter a value to set as a Cookie:

</td>

<td>

<INPUT TYPE="text" NAME="inputbox1" VALUE=""><P>

</td>

</tr>

<tr>

<td>

</td>

<td>

<INPUT TYPE="button" NAME="button" Value="Submit" onClick="setCookie(this.form)">

</td>

</tr>

</table>

</form>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *