Jump to content

help with error


ngreenwood6

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.