PDA

View Full Version : TOS Buttons issue


SwalyAaron
05-29-2013, 07:44 AM
I made this page following this TOS page and would like it to function, I followed a guide I posted below:
http://www.vanquishrsps.com/legal/tos.php

Issue: When I click agree it does "post?"
I know its an issue in the buttons code but how do I fix it?

The guide:


Change the value in red to the location of your agreement page, and place this in the head section of any page where you would like to check if it is the user's first visit:
Code:
<script type="text/javascript">
var agreementPage='agreement.html';
var cookies=document.cookie.split(';');
for(var i=0;i<cookies.length;i++)
if(cookies[i]!=='agreement')
window.location=agreementPage;
</script>
Place this in the head section of your agreement page:

Code:
<script type="text/javascript">
function setCookie()
{
var today = new Date();
var expire=new Date(today.getTime()+100e10);
expire=expire.toUTCString();
document.cookie='agreement; expires=' + expire + '';
}
</script>
Then modify your HTML so the above function is called when the user agrees to your guidelines. If your button is a link, this would be done like so:

Code:
<a href="index.html" onclick="setCookie()">I Agree</a>
This redirects the user to the agreement page if a certain cookie has not been set.[/spoiler]

Lynne
05-29-2013, 01:50 PM
I don't see that javascript in the page at all, so it's not going to work - you need to add that javascript.

SwalyAaron
05-29-2013, 07:00 PM
I gave up and removed it =[ I'll just make it for the specific pages ill be using