RE: [PHP] Branching to a page

2003-09-15 Thread chris . neale
I don't understand what this achieves? Tell me more...

C

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]
Sent: 15 September 2003 03:30
To: [EMAIL PROTECTED]
Subject: [PHP] Branching to a page


Back in the earlier days of PHP, pages were not cached so I developed a 
method of branching to a page by opening a new socket.  Since it has 
worked over the years in quite a variety of applications, I have not 
changed...but maybe I should.  Are there any glaring deficiencies with 
doing this:

  // Verify the Session ID
  if ($session_id) {
  ...
  } else {
bounce_post($server, $path, $url, abort.php, );
exit;
  }

Where bounce is defined as

  function bounce_post($server, $path, $url, $page, $info) {
$http = new http;

$fp = $http-http_fpost($server, $path . $page, $info);
if($fp) {
  print 'BASE HREF=' . $url . $page . 'p';
  fpassthru($fp);
};
  }

Todd

-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

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



Re: [PHP] Branching to a page

2001-12-13 Thread Jason G.

Just send a redirect header.

header(Location: nextpage.php);
exit;

-Jason Garber
IonZoft.com

At 08:45 AM 12/11/2001 -0800, Todd Cary wrote:
I open a socket if I am in the middle of a php script to branch to a
page so that I can send the header information.  However, I understand
that this is not how most php programmers do it.  Could someone share
with me the way it is done with php?

In more detail, this is how I structure a page:

1) The Form calls itself - the same page.

2) At the top of the page, I do my validation and I may check to see if
a Cancel button was pressed.

3) Depending on the circumstances, I branch to another page.

   /* Example: was the Cancel button pressed?
  If so, branch to redirect page */
   if (!empty($cancel)) {
 $http = new http;
 $fp = $http-http_fget($server, $path .
 redirect.php,);
 if($fp) {
   print 'BASE HREF=' . $url .
   'redirect.phpp';
   fpassthru($fp);
   exit;
 }
   }

Many thanks.

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]