bgcolor for php code die

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
boneh
Forum Newbie
Posts: 4
Joined: Mon Oct 11, 2010 2:29 am

bgcolor for php code die

Post by boneh »

hi,
I want a background color when the page die opens.
Here is the code I have now, but only the text change in that color.
Can someone help me plz?

Tyvm

Code: Select all

<?php
if ($check2 == 0) {
echo "<font style='background-color:red'>";
      die('That user does not exist in our database. <a href=register.php>Click Here to Register</a>');
                    }
?>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: bgcolor for php code die

Post by requinix »

Instead of using die(), print out a proper message for the user with HTML and all that.

Why? Because seeing an error page that consists only - literally - of the words
That user does not exist in our database. Click Here to Register
is totally user unfriendly.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: bgcolor for php code die

Post by klevis miho »

Replace with this:

die('<style type="text/css">body{background-color: red;}</style>That user does not exist in our database. <a href=register.php>Click Here to Register</a>');
Post Reply