|
-
Aug 9th, 2007, 05:20 AM
#1
Thread Starter
New Member
die message color??
Code:
$items = mysql_query($query);
if ( ! $items ) die ("Cannot execute $query, contact your Help Desk");
ok, so here is the code that i am using. theres nothing wrong with the code. what i am trying to do is set the color of
Code:
die ("Cannot execute $query, contact your Help Desk");
to a lighter color as it is hardly visible with the background image.
so is there any type of code to change it?? what i have tried to do is;
Code:
$items = mysql_query($query);
if ( ! $items ) die <p class="important">("Cannot execute $query, contact your Help Desk");</p>
p class being pre-defined to a set font and color.
Thanks all!
-
Aug 10th, 2007, 06:11 PM
#2
Hyperactive Member
Re: die message color??
Im no expert with PHP but try this:
Code:
$items = mysql_query($query);
if ( ! $items ) die ("<p class=\"important\">Cannot execute $query, contact your Help Desk</p>");
It may or may not work. let me know.
Hello, Im a complete beginner so I if I ask obvious questions don't laugh. I have had no special training and I thought I'd learn and I thought this is the best place to start.
I started off using VB 6.0 but when I bought a new computer I decided to upgrade to VB 2005, so its a little bit different to what i'm used to
-
Aug 12th, 2007, 12:07 PM
#3
Re: die message color??
yes, lp you are correct. You dont mix HTML in php code, just simply echo the HTML.
My usual boring signature: Something
-
Aug 13th, 2007, 12:39 PM
#4
Re: die message color??
 Originally Posted by dclamp
yes, lp you are correct. You dont mix HTML in php code, just simply echo the HTML.
You can do it either way, as long as you do it correctly:
php Code:
<?php
// ...
$items = mysql_query($query);
if ( ! $items )
{
?>
<p class = "important">Cannot execute <?php echo $query ?>, contact your Help Desk</p>
<?php
die(); // or whatever
}
// continue processing.
?>
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
Aug 15th, 2007, 03:50 AM
#5
Re: die message color??
 Originally Posted by Priapus
Code:
$items = mysql_query($query);
if ( ! $items ) die ("Cannot execute $query, contact your Help Desk");
ok, so here is the code that i am using. theres nothing wrong with the code. what i am trying to do is set the color of
Code:
die ("Cannot execute $query, contact your Help Desk");
to a lighter color as it is hardly visible with the background image.
so is there any type of code to change it?? what i have tried to do is;
Code:
$items = mysql_query($query);
if ( ! $items ) die <p class="important">("Cannot execute $query, contact your Help Desk");</p>
p class being pre-defined to a set font and color.
Thanks all!
Simple solution change the colour. Other simple solution: NEVER use die. It terminates the script abruptly and is not at all user friendly. Unless of course you are using die in the process of debugging then it is ok.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|