vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   TOS page (https://vborg.vbsupport.ru/showthread.php?t=240412)

samimobayed 04-13-2010 11:34 PM

TOS page
 
Hello, i already have created a TOS page using CMPS.
The code of the page is like that:
Quote:

Terms of Service By clicking 'I Agree' you agree to everything stated below:

1. No spam!

Click 'I Agree' if, and only if, you agree to ALL of the above terms.
You must have cookies enabled for this to work.
<p><br />
<a href="accept.php">I Agree</a><br />
<a href="http://www.google.com">Cancel</a></p>
</div>
My accept.php is like that:
Quote:

<meta http-equiv="refresh" content="0;url=http://www.siteishere.com/index.php">
Now how do i make it so that when you click i agree it saves in cookies and doesnt' redirect you to that page again?

Thanks

NoKSouLz 04-14-2010 10:19 AM

in your accept page you would need to add the following:

Code:

<?php setcookie("TOS", Yes, time()+36000, "/"); ?>
This then sets a cookie to say that they have accepted..

Then on your TOS page you would need to add the following code around the page

Code:

<?php
if(isset($_COOKIE['TOS'])){ 
$Agree = $_COOKIE['TOS'];

if($Agree == Yes){

*CODE TO REDIRECT TO HOMEPAGE HERE* }

if(!isset($_COOKIE['TOS'])){  *CODE DISPLAYING TOS ACCEPT AND CANCEL HERE* }

?>

Try that.. that should work.

I use this sort of code to check if my users are logged in on my website.

Explanation (TOS PAGE):

If cookie TOS is set on users computer.. check to see if the variable says Yes..

If so redirects to home page

If no cookie is present shows TOS


-SouLz

samimobayed 04-14-2010 09:50 PM

Thanks, but it doesn't seem to work =S.


All times are GMT. The time now is 06:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01019 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete