Jump to content

Recommended Posts

I am trying to redirect to another page if the $new_pass is not set. It is not working, but it checks to make sure that $new_pass and $confirm_pass match. Any help is appreciated.

 

<?php
session_start();

$new_pass = Trim(stripslashes(md5($_POST['new_pass'])));
$confirm_pass = Trim(stripslashes(md5($_POST['confirm_pass'])));

//define the database variables
$host = "localhost";
$db_name = "login";
$db_table = "members";
$db_username = "root";
$db_password = "";

//function to insert the data into the database
$update_db = "UPDATE members SET password = '$new_pass' WHERE email = '$reset_email'";

//variable to connect to database
$mysqli_connect = mysqli_connect($host,$db_username,$db_password,$db_name)
or die ("Could not connect to database");

if (!$new_pass)
{
include("valid_password.php");
}
elseif(!$confirm_pass)
{
include("valid_password.php");
}
elseif($new_pass != $confirm_pass)
{
include("dont_match.php");
}
else
{
//variable to send data to the database
mysqli_query($mysqli_connect,$update_db)
or die ("Error: ".mysqli_error($mysqli_connect));

include("reset_finished.php");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/118172-help-with-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.