I have this index.php file where the user is able to read an agreement before he enters the site, now I want index.php?agree=yes to link to main.php and index.php?agree=no to link to exit.php. Tried the following, but it always goes straight to main.php, what am I not seeing here ?
<head>
<?php
if (!$agree)
{
$agree = "read";
}
if ($agree = "yes")
{
echo "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=main.php\">";
}
elseif ($agree = "no")
{
echo "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=exit.php\">";
}
?>
</head>
<body>
<?
if ($agree = "read")
{
echo "
<p class=\"style1\">Before you go anywhere on our site, make sure you complete read and agree to this disclaimer. If you do not, leave this site immediately.</p>
<p align=\"center\" class=\"style1\">
<textarea name=\"agreement\" cols=\"80\" rows=\"10\" wrap=\"OFF\" id=\"agreement\"> My agreement goes in here </textarea>
</p>
<p align=\"center\" class=\"style3\"><span class=\"style6\"><a href=\"index.php?agree=no\">I do NOT agree to these terms and wish to leave</a></span><span class=\"style3\"><a href=\"index.php?agree=yes\"><br>
<br>
<span class=\"style6\">I agree to these terms and want to continue</span></a></span></p>";
}
?>
</body>
</html>
Thanks already 🙂