New to PHP - no idea

Hi,

completely new to PHP as I’ve only ever used CSS/HTML. I wanted to make a “verify you are over 18” using session cookies and such, followed a tutorial and it works on my local machine. However, when I upload it to fasthosts I get a 500 internal erver error.

Is there something hugely wrong with my code? Can anyone help please?

[php]
@import “css/DKPSplash.css”;

Verify Your Age

<?php session_start(); if ($_REQUEST["over18"] == 1) { $_SESSION["over18"] = 1; header("Location: " . $_REQUEST["redirect"]); } ?>
<div id="splash">
<img src="Components/DKPSplash.png">
<p></p>
<p>This website contains mature content and is not suitable for under 18's. <br>
Please verify that you understand, are over 18 and wish to contine:</p>
    <a href="home.html">I am over 18</a> | 
    <a href="http://www.google.com/">Get me out of here!</a>
</div>
</body>
[/php]

There could be other reasons why the page is not working but to start with, this php block needs to be above all other code on the page.
[php]

<?php session_start(); if ($_REQUEST["over18"] == 1) { $_SESSION["over18"] = 1; header("Location: " . $_REQUEST["redirect"]); } ?>

[/php]

That block is fine, nothing is being written to the screen.

Where is the info for $_REQUEST coming from? I see links down bottom, but nothing to indicate a form

Sponsor our Newsletter | Privacy Policy | Terms of Service