SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: exit();

  1. #1
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if I use exit(); will it STOP parsing the page? Or just the PHP?

    So.. if I had this..

    Code:
    <html>
    <body>
    Hey everyone!<p>
    Welcome to <?php
    
    echo("My Site");
    
    exit();
    
    ?><p>
    
    <?php echo("Its the best!"); ?>
    
    </body>
    </html>
    With this, what will the browser end up with? Will it just get everything UPTO the exit(); or just everything that the PHP will not parse?

    Thanx for the insight, and I'll try to refrain from bothing you much more!

    God Bless
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  2. #2
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Only stuff that is before the exit;
    Even raw html after that will not be sent to the browser, that is the beauty of the exit;
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to send out an error message and exit at the same time, use this:
    PHP Code:
    die("<b>Error: </b> whatever"); 


Bookmarks

Posting Permissions

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