Jump to content

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


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

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.