Forum Moderators: coopster
<?php if ($_GET["message"]=="sent")
{
?>
Blah Blah
<?php } ?>
<?php if ($_GET["email"]=="sent")
{
?>
Blah Blah
<?php } else { {header( "Location: index.php" );}} ?>
<div class="content">
<?php if ($_GET["kit"]=="sent")
{
?>
<h1>Thank you for applying for your free kit!</h1>
<p>We will dispatch your kit immediately.</p>
<?php } ?>
<?php if ($_GET["email"]=="sent")
{
?>
<h1>Thank you for your enquiry</h1>
<p>Your message has been sent, we will get back to you as soon as possible</p>
<?php //} ?>
<?php } else { {header( "Location: index.php" );}} ?>
</div>
<div class="content">
<?php
if(isset($_GET["kit"]) && ($_GET["kit"] == "sent")){
?>
<h1>Thank you for applying for your free kit!</h1>
<p>We will dispatch your kit immediately.</p>
<?php
}
if (isset($_GET["email"]) && ($_GET["email"] =="sent")){
?>
<h1>Thank you for your enquiry</h1>
<p>Your message has been sent, we will get back to you as soon as possible</p>
<?php
}else{
header("Location: index.php");
exit;
}
?>
</div>
I need both if statements in there to display different messages based on what's in the URL.
if (statement1 validates)
{
// execute code block 1
}
elseif (statement2 validates)
{
// execute code block 2
}
elseif (statement3 validates)
{
// execute code block 3
}
...
else
{
// execute header redirection
}
<?php if ($_GET["kit"]=="sent")
{
echo "<h1>Thank you for applying for your free kit!</h1>"
}
elseif ($_GET["email"]=="sent")
{
echo "<h1>Thank you for your enquiry</h1>"
}
else
{
header("location: index.php");
}
?>
echo "<p>Click <a href='index.php'>here</a> to go back to the home page.</p>";
<a href='index.php'>here</a>.