hi y'all. i just found this site today, but so far, it looks great. anywho, i need a little help.
i'm sure it's simple but i'm having a major brain fart. in the part that says 'this_is_where_i_need_the_redirect' i want it to go to a page named invalid.htm. what the heck do i need to do to get this to work? thanks in advance.

<?
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') 
{     echo  'this_is_where_i_need_the_redirect'; }
 else
{     echo  '<strong>Thank you for your input. If requested, we will contact you as soon as possible.</strong><br>'; };
?>
<?php
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')
{ header("Location: invalid.htm"); }
else
{ echo '<strong>Thank you for your input. If requested, we will contact you as soon as possible.</strong><br>'; };
?>

Matti Ressler
Suomedia

Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/r/a/****/html/communications/csr3.php:8) in /home/content/b/r/a/****/html/communications/csr3.php on line 101


if the incorrect code is put in, i need the "thank you" text in the middle of the page, and the only way i can find to do this is to put it int he middle of the code....so when i put the code posted in the middle, the above error is what i get.

Instead you can use:

<?php
$redirect = false;
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')
{ $redirect = true; }
?>

Then later in your script you can check the $redirect variable:

<?php
if ($redirect == true)
{ header("Location: invalid.htm"); }
else
{ echo '<strong>Thank you for your input. If requested, we will contact you as soon as possible.</strong><br>'; };
?>

Matti Ressler
Suomedia

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.