Page 1 of 1

bgcolor for php code die

Posted: Tue Oct 26, 2010 4:05 am
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>');
                    }
?>

Re: bgcolor for php code die

Posted: Tue Oct 26, 2010 4:39 am
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.

Re: bgcolor for php code die

Posted: Fri Oct 29, 2010 6:30 am
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>');