GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   enabling a cookie with an onclick button? (https://gfy.com/showthread.php?t=870201)

Angry Jew Cat - Banned for Life 11-19-2008 02:54 AM

enabling a cookie with an onclick button?
 
i need tofigure out how i can set a cookie to view a page after a user has submitted info, perhaps with an onclick button. is this done with javascript? i've never worked with cookies, how cani set this up? i don't want users to see this page as visible unless they have submitted their information for my opt in list and clicked the button to view. suggestions? :helpme:helpme:helpme

Angry Jew Cat - Banned for Life 11-19-2008 06:46 AM

morning bump

Angry Jew Cat - Banned for Life 11-19-2008 07:09 PM

rebumping

spacedog 11-19-2008 08:26 PM

PHP Code:

<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-2010 5:00:00 GMT";
}

}
</SCRIPT>



<FORM NAME="cf">

<INPUT TYPE="text" NAME="cfd" size="20">
<INPUT TYPE="button" Value="Set to Cookie" 
onClick="putCookie()">

</FORM> 



All times are GMT -7. The time now is 08:28 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123