/    Sign up×
Community /Pin to ProfileBookmark

Access external CSS file from PHP file?

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

[code=php]
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>’;
}
[/code]

Please give me some advises. Thanks!

[URL=http://www.cuj06.com/home_page/password.php]Link to the php file[/URL]

[URL=http://www.cuj06.com/home_page/homepage_filestructure.jpg]file structure image[/URL]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@holidayDec 08.2007 — couldn't you just put this html in the head of your document[code=html]<link href="global.css" rel="stylesheet" type="text/css" />[/code]
×

Success!

Help @webdev077 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...