Re: how to exist within the context?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Put all your footer html/code into a function called 'foot'

Then do:

if (must_die(...)){
  foot();
  exit;
}

On Tue, November 22, 2005 11:27 am, Bing Du wrote:
> Hi,
>
> One webpage has its banner, left menu and footer ect that are
> controled
> by the template.  I want this php script to output the form and
> processing result within the page structure.  Without exit, if the
> 'yourname' field is empty, the script would output 'Please enter your
> name!' fine within the page structure (that is, banner, menu and
> footer
> are all there).  But obviously the script does not terminate as it's
> supposed to.  With exit, the script terminates fine, but it outputs
> the
> result in a page without banner, menu and footer.  So what's the
> correct
> way to get the script stop and output its results always in the page
> structure.
>
> <form method=post>
> <input name="yourname" type="text" size="20">
> <input name="submit" type="submit" value="submit">
> </form>
>
> <?php
>
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
>     if ($name=="")
>    {
>      print "Please enter your name!";
>      //exit;
>    }
> }
>
> echo "Continue processing...";
> ?>
>
> Thanks in advance,
>
> Bing
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux