-1

I'm making a login and registration system but my header redirect isn't working properly, Instead of redirecting me to my home.php page on log in it is bringing me to my index.php.

Here is the code:

$_SESSION["user_login"] = $user_login;
header("Location: home.php");
  exit();
} else {
    echo 'That information is incorrect, try again';
    exit();

Why form action is set to index.php but when I change it to home.php it sends me there but does not log me in. Here is the form code:

<form action="index.php" method="POST">
    <input type="text" name="user_login" size="25" placeholder="Username" /><br /><br />
    <input type="text" name="password_login" size="25" placeholder="Password" /><br /><br />
    <input type="submit" name="login" value="Login">
</form>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • can you please add your complete index.php code – Amit Kumar Sahu Jan 03 '17 at 07:42
  • [The HTML5 placeholder attribute is not a substitute for the label element](http://www.456bereastreet.com/archive/201204/the_html5_placeholder_attribute_is_not_a_substitute_for_the_label_element/) – Quentin Jan 03 '17 at 11:30

1 Answers1

-2
exit();

terminates program, so remove it and try again.

Rakyesh Kadadas
  • 851
  • 9
  • 11