Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Bas Jobsen

Do:
 FILE A:

 ?php
 if (empty($_POST['search_criteria'))
 {
   echo You must provide search criteria;

   // exit the include file here But how?
  }
 else
{
 echo You have provided serach criteria;
}
 ?


Op woensdag 21 augustus 2002 16:39, schreef Henry:
 Hi All,

 I would like to exit from an include file and continue in the calling
 script!

 As an example

 FILE A:

 ?php
 if (empty($_POST['search_criteria'))
 {
   echo You must provide search criteria;

   // exit the include file here But how?
  }

 echo You have provided serach criteria;
 ?


 FILE B

 #include A;

 form method=post
 input name=search_criteria type=text
 /form

 TIA

 Henry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Exiting from an include or required file

2002-08-21 Thread Roedel, Mark


Seems like the easy way, at least in this case, would be to make the
second part of your File A an else to your if.

?php
if (empty($_POST['search_criteria'])) {
echo You must provide search criteria;
} else {
echo You provided search criteria;
}


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


 -Original Message-
 From: Henry [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, August 21, 2002 9:40 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Exiting from an include or required file
 
 
 Hi All,
 
 I would like to exit from an include file and continue in the calling
 script!
 
 As an example
 
 FILE A:
 
 ?php
 if (empty($_POST['search_criteria'))
 {
   echo You must provide search criteria;
 
   // exit the include file here But how?
  }
 
 echo You have provided serach criteria;
 ?
 
 
 FILE B
 
 #include A;
 
 form method=post
 input name=search_criteria type=text
 /form
 
 TIA
 
 Henry
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Exiting from an include or required file

2002-08-21 Thread M . A . Bond

Or just do a return();

?php
if (empty($_POST['search_criteria'])) 
{
echo You must provide search criteria;
  return;
}



-Original Message-
From: Roedel, Mark [mailto:[EMAIL PROTECTED]] 
Sent: 21 August 2002 15:48
To: Henry; php-general
Subject: RE: [PHP] Exiting from an include or required file



Seems like the easy way, at least in this case, would be to make the second
part of your File A an else to your if.

?php
if (empty($_POST['search_criteria'])) {
echo You must provide search criteria;
} else {
echo You provided search criteria;
}


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


 -Original Message-
 From: Henry [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 21, 2002 9:40 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Exiting from an include or required file
 
 
 Hi All,
 
 I would like to exit from an include file and continue in the calling 
 script!
 
 As an example
 
 FILE A:
 
 ?php
 if (empty($_POST['search_criteria'))
 {
   echo You must provide search criteria;
 
   // exit the include file here But how?
  }
 
 echo You have provided serach criteria;
 ?
 
 
 FILE B
 
 #include A;
 
 form method=post
 input name=search_criteria type=text
 /form
 
 TIA
 
 Henry
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Henry

Thanks, but my situation is slight more convoluted than I describe.

I want to cascade down through a include chain and want to just stop
processing the current include and return to the one which called it.
Similar to exit() but only for the local scope.

TIA

Henry

Mark Roedel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

Seems like the easy way, at least in this case, would be to make the
second part of your File A an else to your if.

?php
if (empty($_POST['search_criteria'])) {
echo You must provide search criteria;
} else {
echo You provided search criteria;
}


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


 -Original Message-
 From: Henry [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 21, 2002 9:40 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Exiting from an include or required file


 Hi All,

 I would like to exit from an include file and continue in the calling
 script!

 As an example

 FILE A:

 ?php
 if (empty($_POST['search_criteria'))
 {
   echo You must provide search criteria;

   // exit the include file here But how?
  }

 echo You have provided serach criteria;
 ?


 FILE B

 #include A;

 form method=post
 input name=search_criteria type=text
 /form

 TIA

 Henry



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Henry

Thanks return thats it!

I hadn't appreciated that include was a function! I keep thinking like a
C/C++ programmer, must stop. Punishment is 8 lines of include is not a
pre-processor directive.

include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive
include is not a pre-processor directive



Thankyou once again

Henry



M A Bond [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Or just do a return();

 ?php
 if (empty($_POST['search_criteria']))
 {
 echo You must provide search criteria;
   return;
 }



 -Original Message-
 From: Roedel, Mark [mailto:[EMAIL PROTECTED]]
 Sent: 21 August 2002 15:48
 To: Henry; php-general
 Subject: RE: [PHP] Exiting from an include or required file



 Seems like the easy way, at least in this case, would be to make the
second
 part of your File A an else to your if.

 ?php
 if (empty($_POST['search_criteria'])) {
 echo You must provide search criteria;
 } else {
 echo You provided search criteria;
 }


 ---
 Mark Roedel   | Blessed is he who has learned to laugh
 Systems Programmer|  at himself, for he shall never cease
 LeTourneau University |  to be entertained.
 Longview, Texas, USA  |  -- John Powell


  -Original Message-
  From: Henry [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 21, 2002 9:40 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Exiting from an include or required file
 
 
  Hi All,
 
  I would like to exit from an include file and continue in the calling
  script!
 
  As an example
 
  FILE A:
 
  ?php
  if (empty($_POST['search_criteria'))
  {
echo You must provide search criteria;
 
// exit the include file here But how?
   }
 
  echo You have provided serach criteria;
  ?
 
 
  FILE B
 
  #include A;
 
  form method=post
  input name=search_criteria type=text
  /form
 
  TIA
 
  Henry
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Joseph W. Goff

You will have to enclose the code is some form of a container.
i.e. a function, while loop...
I would probably use the function, then you could exit with return
The other types of container would use break.
- Original Message - 
From: Henry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 21, 2002 9:59 AM
Subject: Re: [PHP] Exiting from an include or required file


 Thanks, but my situation is slight more convoluted than I describe.
 
 I want to cascade down through a include chain and want to just stop
 processing the current include and return to the one which called it.
 Similar to exit() but only for the local scope.
 
 TIA
 
 Henry
 
 Mark Roedel [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 Seems like the easy way, at least in this case, would be to make the
 second part of your File A an else to your if.
 
 ?php
 if (empty($_POST['search_criteria'])) {
 echo You must provide search criteria;
 } else {
 echo You provided search criteria;
 }
 
 
 ---
 Mark Roedel   | Blessed is he who has learned to laugh
 Systems Programmer|  at himself, for he shall never cease
 LeTourneau University |  to be entertained.
 Longview, Texas, USA  |  -- John Powell
 
 
  -Original Message-
  From: Henry [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 21, 2002 9:40 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Exiting from an include or required file
 
 
  Hi All,
 
  I would like to exit from an include file and continue in the calling
  script!
 
  As an example
 
  FILE A:
 
  ?php
  if (empty($_POST['search_criteria'))
  {
echo You must provide search criteria;
 
// exit the include file here But how?
   }
 
  echo You have provided serach criteria;
  ?
 
 
  FILE B
 
  #include A;
 
  form method=post
  input name=search_criteria type=text
  /form
 
  TIA
 
  Henry
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Joseph W. Goff

Actually, M.A.Bond is right, you don't even have to enclose it, just use the
return construct.
- Original Message -
From: Joseph W. Goff [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]; Henry
[EMAIL PROTECTED]
Sent: Wednesday, August 21, 2002 10:03 AM
Subject: Re: [PHP] Exiting from an include or required file


 You will have to enclose the code is some form of a container.
 i.e. a function, while loop...
 I would probably use the function, then you could exit with return
 The other types of container would use break.
 - Original Message -
 From: Henry [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 21, 2002 9:59 AM
 Subject: Re: [PHP] Exiting from an include or required file


  Thanks, but my situation is slight more convoluted than I describe.
 
  I want to cascade down through a include chain and want to just stop
  processing the current include and return to the one which called it.
  Similar to exit() but only for the local scope.
 
  TIA
 
  Henry
 
  Mark Roedel [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  Seems like the easy way, at least in this case, would be to make the
  second part of your File A an else to your if.
 
  ?php
  if (empty($_POST['search_criteria'])) {
  echo You must provide search criteria;
  } else {
  echo You provided search criteria;
  }
 
 
  ---
  Mark Roedel   | Blessed is he who has learned to laugh
  Systems Programmer|  at himself, for he shall never cease
  LeTourneau University |  to be entertained.
  Longview, Texas, USA  |  -- John Powell
 
 
   -Original Message-
   From: Henry [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, August 21, 2002 9:40 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Exiting from an include or required file
  
  
   Hi All,
  
   I would like to exit from an include file and continue in the calling
   script!
  
   As an example
  
   FILE A:
  
   ?php
   if (empty($_POST['search_criteria'))
   {
 echo You must provide search criteria;
  
 // exit the include file here But how?
}
  
   echo You have provided serach criteria;
   ?
  
  
   FILE B
  
   #include A;
  
   form method=post
   input name=search_criteria type=text
   /form
  
   TIA
  
   Henry
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php