Jump to content

If you don't have this take you to this...


Im Jake

Recommended Posts

<?php
$cookiename = "RFant_agree";
$cookiecontent = "yes";

if(isset($_COOKIE[$cookiename])){
header("Location: http://".$_SERVER['SERVER_NAME']."/index.php");
} elseif(isset($_POST['Cancel'])){
die("You must agree to the TOS to view the site, sorry.");
} elseif(isset($_POST['Submit']) && (strtolower($_POST['agree']) == "yes")){

setcookie($cookiename, $cookiecontent, time() + 2592000);
// $fp = fopen("log" , "a" );
// fwrite($fp, $_SERVER['REMOTE_ADDR']."\n");
// fclose($fp);
if(isset($_GET['returnto']))
header("Location: ".$_GET['returnto']);
else
header("Location: http://".$_SERVER['SERVER_NAME']."/index.php");

} else {

showheader();
showTOS();

echo '<font color="white">Type <i>\'yes\'</i> if you agree to <i>ALL</i> of the above terms.<br />
You must have cookies enabled for this to work.</font> <br />';
if(isset($_GET['returnto']))
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."?returnto=".$_GET['returnto']."\">";
else
echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";

echo ' <input name="agree" size="20" /><br />
<input type="submit" name="Submit" value="I Agree" />
<input type="submit" name="Cancel" value="Cancel" />
</form>';

showfooter();
}

function showheader() {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>'.$_SERVER['SERVER_NAME'].' TOS</title>
<style type="text/css">
body{font-family: verdana; font-size: 10pt;}
div{background: #3d71ad; width: 70%; border: 1px solid black; font-family: verdana; font-size: 10pt;}
input{border: 1px solid black;}
</style>
</head>
<body bgcolor="#666666">
<center>
<div>
<b>'.$_SERVER['SERVER_NAME'].' Terms of Service</b>
</div>
<br />
';
}

function showfooter() {
echo '</center>
</body>
</html>';
}

function showTOS() {
echo '<div style="text-align: left;">
<tt>
By typing <i>\'yes\'</i> you agree to everything stated below:<br /><br />

You are not an employee of Jagex LTD, runescape, or adlex solicitors,
and are not a family member or acquaintance of the aforementioned.<br /><br />

All of the information on this site is solely for learning purposes, as
the main purpose of this site is to instruct people in the art of programming.
All programs provided for download from this site are entirely coded by the members
of this community and are not the intellectual property of any business or organization.
</tt>
</div>


<br />


<div style="text-align: left;">
<tt>
In order to use the forum you must agree to all of these rules as well:<br />
<ol>
<li>We are not anti-leech. If you respect our community and our ideas, feel free to ask questions and they will be kindly answered if you follow other rules. Answer to questions that others ask if you know the answer or remain silent!</li><br />

<li>We don\'t talk about things we don\'t know. This is an informative, not uninformative community.</li><br />

<li>We don\'t make spelling mistakes on purpose. We use "you" not "u", we use "why" not "y" etc.</li><br />

<li>We don\'t make posts that contain useless information. Posts like "cool", "lol", "yeah" and
"I agree" don\'t contain anything useful for others. We are not fans of off topic, unless it contains
something smart or funny. Most of things spammers find funny are actually not funny at all.</li><br />

<li>We don\'t "bump" or double post.</li><br />

<li>We respect each other and other communities. We don\'t flame each other or other communities.
We don\'t fight on the forums.</li><br />

<li>We don\'t advertise other sites or communities unless we ask and receive permission to.</li><br />

<li>We don\'t care about post count alone. If someone has high post count and most of it is spam,
we hate him. If someone has high post count with informative posts, we love him. The higher count, the
more we hate/love him.</li><br />

<li>DO NOT post or upload any copyrighted materials, ie deobs, clients or any other sort.</li><br />

<li>We don\'t sell anything on these forums.</li><br />

<li>We never have misleading links in your signatures. If your signature says www.google.com,
we expect it to take us to google.com.</li><br />
</ol>
</tt>
</div>

<br /><br />';
}
?>

 

This is my code, I want it so that if you dont have the cookie RFant_agree then you get redirected to www.mydomain.com/tos.php and when you type yes and agree it takes you to where you were going...

Link to comment
Share on other sites

<?php
if (!$_COOKIE['RFant_agree']) {
header("Location: tos.php");
exit();
}
?>

 

Then in TOS.php:

 

<?php
if (isset($_POST['check'])) {
$_COOKIE['RFant_agree'] = 1;
header("Location: index.php");
exit();
}
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.