Jump to content

[SOLVED] Where do I add <div> to php Code?


bgbs

Recommended Posts

I would like to wrap all Error messages in one <div> block.

Where do I began the DIV tag and where do I end it?

 

	
if (!empty($_POST['action'])) 
{

$action = $_POST['action'];
$passwordExisting = $_POST['passwordExisting'];
$passwordNew = $_POST['passwordNew'];
$passwordConfirm = $_POST['passwordConfirm'];



}

if ($action == "change")
{
if (empty($passwordExisting)  )
	{
	$errors .= "<p>» You didn't enter your Existing Password</p>";
	}
if (empty($passwordNew))
	{
	$errors .= "<p>» You didn't enter a New Password</p>";
	}
if (empty($passwordConfirm))
	{
	$errors .= "<p>» You didn't enter a Confirmed New Password</p>";
	}
if ($passwordConfirm != $passwordNew)
	{
	$errors .= "<p>» Your New Password and Confirmed Password Do Not Match.</p>";
	}



$p_user = $db->get_row("SELECT first_name FROM user WHERE uvar = '$uvar' AND pass='$passwordExisting'");

if (empty($p_user->first_name))
	{
	//password is wrong
	$errors .= "» You entered the wrong Exiting Password. <p><a href='../forgot.php'>If you forgot your existing password, click here.</a></p>";
	}
else
	{
	// user does exist, set cookie and redirect
	if (empty($errors))
		{

		$db->query("UPDATE user SET pass = '$passwordNew' WHERE uvar = '$uvar'");
		$success = "<div class='updated-message'>Your password has been changed.</div>";

		$passwordExisting = "";
		$passwordNew = "";
		$passwordConfirm = "";



		}

	}

Link to comment
https://forums.phpfreaks.com/topic/181041-solved-where-do-i-add-to-php-code/
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.