Hi, i’m really stuck and would like some help…
I’ve made a simple page that will redirect a user to their desired page if they agree to a terms and conditions… the thing is, if a user doesn’t click the agree box, the page comes up but certain elements are removed from the page… the background and text formatting being the main bits…
I’ve viewed source on the page that loads once a user clicks submit without checking the box and it gives out the following error at the top of the page…
Notice: Undefined index: terms_ok in C:Program FilesEasyPHP 2.0b1wwwPopCapgame_redirect.php on line 16
If you do a refresh on this page that hasn’t loaded correctly it does indeed load the page correctly…
Obviously it’s a problem with the terms_ok checkbox but i don’t know why it is doing this??
I have played with the code a bit to remove certain information on the forum so if you paste it into a php editor the lines might be a bit messed up…
Please please please help me with this guys!
Thanks,
Andrew
[php]<?php
$terms_error = ‘’;
$selected_game = $_GET[‘game’];
$file_extension = ‘.php’;
$go_where = $selected_game.$file_extension;
if (isset($_POST[‘submitted’])) {
$valid = 1;
$terms = $_POST[‘terms_ok’];
if ( empty($terms) ) {
$valid = 0;
$terms_error = ‘Click ‘I Agree’ to proceed.’;
( $valid == 1 ) {
header(‘Location:’ .$go_where);
exit;
}
}
?>
[/php]
<HTML>
<HEAD>
<Link rel="stylesheet" type="text/css" href="stylesheet.css">
<TITLE>Terms & Conditions</TITLE>
</HEAD>
<BODY>
<!-- Elements Begin -->
<?php include "common_elements.html"; ?>
<!-- Terms & Conditions Begin -->
<div class="game_holder">Terms & Conditions<br><br>
<!-- Terms Checkbox Begin -->
<form enctype="multipart/form-data" method="post" action="">
<!-- Terms Text Begin -->
<iframe width="450" height="332" src="terms.html"></iframe>
<!-- Terms Text End -->
<br>
<span style="color:#666666";>I Agree to the Terms & Conditions:</span>
<input type="checkbox" name="terms_ok" value="agree"></input>
<span style="font-size:8pt; color:red;"><?php echo $terms_error; ?></span>
<br>
<input type="submit" name="submitted" value="Lets Go!" ></input>
</form>
<!-- Terms Checkbox End -->
</div>
<!-- Terms & Conditions End -->
<!-- Ads Begin -->
<!-- Sky -->
<div class="skyscraper">Sky Ad</div>
<!-- Leaderboard -->
<div class="banner">Banner Ad<div>
<!-- Ads End -->
</BODY>
</HTML>