Page 1 of 1

simple password

Posted: Thu Jun 19, 2003 3:50 pm
by jamrop
Using a form to submit a global password. When the password is entered it goes to cv.php with the following code

Code: Select all

<?php
if ( ! $password == 'in')
&#123; header("location:cv.html") ; exit();&#125;
else &#123; 
   
   header("Location: index.htm"); &#125;

?>
if the password is correct it should open cv.html, but it
does not seem to work, it just goes back to index.htm

can anyone help plz

Posted: Thu Jun 19, 2003 4:13 pm
by twigletmac

Posted: Thu Jun 19, 2003 4:13 pm
by Galahad
What happens if the password is incorrect? Maybe you should change:

Code: Select all

<?php
if ( ! $password == 'in')
?>
to be:

Code: Select all

<?php
if ($password == 'in')
?>
That way, if the password is 'in' it goes to cv.html, otherwise it goes to index.html.

twigletmac may be onto something, are you sure $password gets set? Try echoing it.

Posted: Thu Jun 19, 2003 4:53 pm
by jamrop
hey

thanks for help

it was the ! in the code

silly mistake

thanks