web88js
08 Dec 2007, 03:28 AM
Hello everyone:
I am working a project that display a form between header and footer section. I want to center the error message just above the form.
I have three files header.php, footer.php and password.php. I use php include to include header and footer section.
Within the header.php file, I accessed an external style sheet - global.css which have all the styles.
I don't know what approach should I use to crate a style in global.css file so I can make the error message display right above the form after user click update password button.
a) Should I add div elements in header.php file ?
Code Segment in password.php file
if($num == 1)
{
$row = mysql_fetch_array($result, MYSQL_NUM);
$query = "update friend set password=SHA('$newpd')
where user_id=$row[0]";
$result = mysql_query($query);
//user password being successfully updated
if(mysql_affected_rows() == 1)
{
echo '<h1 id="mainhead">Thank You!</h1>
<p>Your password has been updated.</p>';
}
else
{
echo '<h1 id="mainhead">System Error!</h1>
<p class="error">Your password could not be changed due to a system error.</p>';
}
}
//display error message if there were no matching records found in db
else
{
echo '<h1 id="mainhead">Error!</h1>
<p class="error">Your email address and password do not match those on file. Please
try again.</p>';
}
Please give me some advises. Thanks!
Link to the php file (http://www.cuj06.com/home_page/password.php)
file structure image (http://www.cuj06.com/home_page/homepage_filestructure.jpg)
I am working a project that display a form between header and footer section. I want to center the error message just above the form.
I have three files header.php, footer.php and password.php. I use php include to include header and footer section.
Within the header.php file, I accessed an external style sheet - global.css which have all the styles.
I don't know what approach should I use to crate a style in global.css file so I can make the error message display right above the form after user click update password button.
a) Should I add div elements in header.php file ?
Code Segment in password.php file
if($num == 1)
{
$row = mysql_fetch_array($result, MYSQL_NUM);
$query = "update friend set password=SHA('$newpd')
where user_id=$row[0]";
$result = mysql_query($query);
//user password being successfully updated
if(mysql_affected_rows() == 1)
{
echo '<h1 id="mainhead">Thank You!</h1>
<p>Your password has been updated.</p>';
}
else
{
echo '<h1 id="mainhead">System Error!</h1>
<p class="error">Your password could not be changed due to a system error.</p>';
}
}
//display error message if there were no matching records found in db
else
{
echo '<h1 id="mainhead">Error!</h1>
<p class="error">Your email address and password do not match those on file. Please
try again.</p>';
}
Please give me some advises. Thanks!
Link to the php file (http://www.cuj06.com/home_page/password.php)
file structure image (http://www.cuj06.com/home_page/homepage_filestructure.jpg)