Does PHP wait? (no replies)

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
Submitted by programmer on Thu, 08/14/2008 - 17:34.

Hi!

I have a php class that validates user submited content. It goes something like this:

$var = $validate->fct($_POST['something']);


... and in my class:

function fct($var){
   //validates data
   if($noproblem){
      return $var;
   }else{
      //logout the user and exit();
   }
}


I need to be sure that the script exits when !$noproblem. I really don't know if the php waits for the function to end or if it goes on. Any help?

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.