/    Sign up×
Community /Pin to ProfileBookmark

Displaying Error in HTML?

Hey here is my code, How do I display the error messages inside the HTML? Do I wrap tables around the echo tags or what? I have no clue.

Here are the echos for the errors

[code=php]<?php
if (isset($error_message))
{
echo ‘<span style=”color:red”>’;
echo $error_message;
echo ‘</span>’;
}
?>[/code]

[code=html]<body>
<div id=”background” onload=”MM_preloadImages(‘login/images/background.jpg’)”></div>
<div id=”clientform”>
<form action=”<?php echo $_SERVER[‘PHP_SELF’]?>” method=”post”>
<table width=”120″ border=”0″ cellspacing=”8″ cellpadding=”0″>
<tr>
<td><label>
<input name=”username” type=”text” id=”username” size=”15″ />
</label></td>
</tr>
<tr>
<td><label>
<input name=”pass” type=”password” id=”pass” size=”15″ />
</label></td>
</tr>
<tr align=right>
<td><label>
<input type=”submit” name=”Submit” value=”Login” />
</label></td>
</tr>
</table>
</form>
</div>
<?php
if (isset($error_message)){
echo ‘<span style=”color:red”>’;
echo $error_message;
echo ‘</span>’;
}
?>
<div id=”navbg”></div>
<div id=”navigation”>
<script type=”text/javascript”>
AC_FL_RunContent( ‘codebase’,’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0′,’width’,’217′,’height’,’301′,’src’,’flash/nav’,’quality’,’high’,’pluginspage’,’http://www.macromedia.com/go/getflashplayer’,’wmode’,’transparent’,’movie’,’flash/nav’ ); //end AC code
</script><noscript><object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0″ width=”217″ height=”301″>
<param name=”movie” value=”flash/nav.swf” />
<param name=”quality” value=”high” />
<param name=”wmode” value=”transparent” />
<embed src=”flash/nav.swf” width=”217″ height=”301″ quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” wmode=”transparent”></embed>
</object>
</noscript></div>
</body>[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@SheldonJul 02.2006 — Well that should work?

I donty see how you are setting the variable $error_message but how you have it will work
Copy linkTweet thisAlerts:
@GreyFilmProauthorJul 02.2006 — What do u mean? I dont see how you are setting the variable $error_message[/QUOTE] Could that be why the error isnt displaying? Ive tried everyway I know of displaying the errors in HTML but it hasnt worked.
Copy linkTweet thisAlerts:
@SheldonJul 02.2006 — how are you processing the form? your form action says that the same page is processing the form yet there is no php processing on that page you posted? Post more code please
×

Success!

Help @GreyFilmPro 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...