Results 1 to 6 of 6

Thread: [RESOLVED] Stop PHP file executing

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Resolved [RESOLVED] Stop PHP file executing

    Can i do this? what would be the correct syntax?

    If somthing
    {

    } else
    {

    exit do not execute anything more

    }

    Thankjs

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Stop PHP file executing

    I'm not shure what you are asking, stop part of the code from executing or stopping the file from being processed at all?

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Stop PHP file executing

    sorry say we have this.....

    If this is true {

    do this

    }else{

    stop execution of all the file below

    }

    more commands, on executed if above was true.

    basicly and exit sub kind of thing

    Thanks

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Stop PHP file executing

    Ah, I understand now

    Something like this?

    Code:
    if ($Something)
    {
    echo 'Looks like you can continue then!';
    }
    else
    {
    echo 'Sorry you can go no further!';
    exit(0);
    }
    
    # Anything down here will only execute if the above IF statement was true.
    Cheers,

    Ryan Jones
    Last edited by sciguyryan; Feb 7th, 2006 at 02:55 PM.
    My Blog.

    Ryan Jones.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Stop PHP file executing

    i knew it would be somthing simple. Thanks

  6. #6
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Stop PHP file executing

    Quote Originally Posted by Pino
    i knew it would be somthing simple. Thanks
    PHP makes many things simple, when you know what the things are

    There is another called die(); that allows you to do the same thing.

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

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