Results 1 to 5 of 5

Thread: die message color??

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    5

    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!

  2. #2
    Hyperactive Member leeprice2006's Avatar
    Join Date
    Jul 2006
    Posts
    258

    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

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  4. #4
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Re: die message color??

    Quote 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:
    1. <?php
    2.    // ...
    3.    $items = mysql_query($query);
    4.    if ( ! $items )
    5.    {
    6.      ?>
    7.       <p class = "important">Cannot execute <?php echo $query ?>, contact your Help Desk</p>
    8.      <?php
    9.       die(); // or whatever
    10.    }
    11.    // continue processing.
    12. ?>
    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.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: die message color??

    Quote 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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width