Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts

    Error Message Interpretation Help

    What does an error like this mean:

    getMessage(); } /* Include the HTML for the form */ require_once('./lib/form.php'); ?>
    It is a result of the following code:
    PHP Code:
    <? 
        
    try {
            require_once(
    './lib/login.class.php');
            
    $login = new Login;
        }
        catch(
    Exception $error) {
            print 
    $error->getMessage();
        }
        
        
    /* Include the HTML for the form */
        
    require_once('./lib/form.php');     
    ?>

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    It's not an error message... its your source code. ... Don't know why, though.
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Thats most interesting.
    The answer is easy if you get the entire source in there, it would likely be due to having short tags disabled. But if its just a partial I'm at a complete loss - unless the Exception class is doing something funky and interpreting messages as php code, which is doubtful.
    Sorry mate, all I can tell you from here is that its nothing with your syntax at all, looks fine to me. The only thing I can suggest is in your catch to try doing nothing at all to see if it resolves the problem, or use an $error->printStackTrace(); (I think thats what it is in php, you may need to look up the method call) - print stack trace doesn't need to be printed out btw it will do that by itself.
    This is really weird though, I don't generally print out messages from exceptions but ones I consider fatal I do write to a log file and have had no troubles from it. Could be the php version as well, the early 5.x versions had... questionable objects to begin with.
    Hope you get it solved!
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by srule_ View Post
    What does an error like this mean:



    It is a result of the following code:
    PHP Code:
    <? 
        
    try {
            require_once(
    './lib/login.class.php');
            
    $login = new Login;
        }
        catch(
    Exception $error) {
            print 
    $error->getMessage();
        }
        
        
    /* Include the HTML for the form */
        
    require_once('./lib/form.php');     
    ?>
    I guess, class Login use form.php and you create a instance in 'try' before including form.php.
    I could be wrong,

    best regards

  • #5
    Regular Coder
    Join Date
    Jun 2004
    Posts
    565
    Thanks
    0
    Thanked 18 Times in 18 Posts
    The "error message" is just the source code when viewed in a browser. Everything between <? and -> is interpreted as a HTML tag and thus not shown.

    If you do a View Source on the site you will see the full source code.

    The real error here is that your server is not configured to feed .php files to PHP on requests (or the file has a wrong extension).

    Search the web for instructions on how to configure your server for PHP.

    dumpfi
    "Failure is not an option. It comes bundled with the software."
    ....../)/)..(\__/).(\(\................../)_/)......
    .....(-.-).(='.'=).(-.-)................(o.O)...../<)
    ....(.).(.)("}_("}(.)(.)...............(.)_(.))Ż/.
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
    Little did the bunnies suspect that one of them was a psychotic mass murderer with a 6 ft. axe.

  • Users who have thanked dumpfi for this post:

    Bobafart (01-04-2008)


  •  

    Posting Permissions

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