Re: [PHP-DB] Auto load PHP

2001-04-03 Thread Renze Munnik

On Tue, Apr 03, 2001 at 09:05:57AM +0100, Galvin, Max wrote:
 Why not a simple if statement to check if the function worked and then
 include("script2.php") ?
 
 M
 


Well... I've got three reasons for that...

1. I never use include() for redirection. It was never meant to be
used for that anyway.

2. If you use include() you're only using up more memory. And I
don't know 'bout you, but I always try to write as efficient as I
can.

3. When you redirect someone, you want them to go to a different
page don't you? Using include() they still stay on the same page.
They only get a different content.

So... using header() instead of include() is more efficient i.m.o.
And besides that; my projects get pretty large. In that case it's
smart to keep your code 'easy-to-track'. If you start including
instead of redirecting it only gets more complex tracking the flow
of the site. And that while include() offers no advantages.

[ I.m.o. ]

-- 

* RzE:

***
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***

-- 
PHP Database 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]




Re: [PHP-DB] Auto load PHP

2001-04-03 Thread Renze Munnik

On Tue, Apr 03, 2001 at 09:48:07AM +0100, Galvin, Max wrote:
 Jim Ray didn't say he wanted it redirected though, he said he wanted it
 "called". Redirecting was brought in by someone who replied to the post.
 
 I would also use header() but if the poster is looking for a quick "plug in"
 solution without having to alter any output he's already made, include or
 require are the simplest way. Whilst overhead is important, is taking a day
 to rewrite a complex script worth the tiny amount of speed/memory saving he
 might make?
 
 M
 

Well, okay...
I've read the original msg from J.R. again and indeed, he doesn't
want to redirect. My answ was mainly based on the post from D.B.

[ To J.R. ]
Having read the org. msg.; I don't know if you are trying to do
this. Anyway... You can also create the HTML/PHP-page you want to show,
and then put the update statement at the beginning. Something like the
following pseudo:

# Result page

- Update table

- HTML
-- html-content
- /HTML


This doesn't make much of a difference with including the HTML-part
though. It's just what you like more...
All your choice...

-- 

* RzE:

***
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***

-- 
PHP Database 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]




RE: [PHP-DB] Auto load PHP

2001-04-03 Thread Michael Rudel

?php
   // Redirects to another Page using HTTP-META Tag
   function redirect( $url, $message = "", $delay = 0 )
   {
  /* redirects to a new URL using meta tags */
  echo "meta http-equiv='Refresh' content='".$delay."; url=".$url."'";
  if ( !empty( $message ) )
 die( "div style='font-family: Arial, Sans-serif; font-size: 12pt;' 
align=center ".$message." /div" );
   }
?

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -
___

Suchtreffer AG
Bleicherstrae 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Renze Munnik [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 03, 2001 9:57 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Auto load PHP


 David Balatero wrote:
 
  Maybe after the UPDATE statement, you could do:
 
  ?php
  header("Location: /path/to/other/script.php");
  ?
 
  ...but I don't know, I don't use header() that much.
 
  -- David Balatero
 
  -Original Message-
  From: Jim Ray [mailto:[EMAIL PROTECTED]]
  Sent: Monday, April 02, 2001 6:23 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Auto load PHP
 
  Is there a way, once updating a table to load another PHP?
 After, I have the
  user click on the save button, the code calls a update
 routine. After the
  UPDATE is done, I want the code to call another progam.
 
  Thank you.
 
  Jim


 Yep... the header-function should work. There's only one nasty
 restriction... You can only use the header-function BEFORE ANY OTHER
 OUTPUT HAS BEEN GENERATED.
 --

 * RzE:

 ***
 **  Renze Munnik
 **
 **  E: [EMAIL PROTECTED]
 **  M: +31 6 218 111 43
 ***

 --
 PHP Database 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 Database 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]




RE: [PHP-DB] Auto load PHP

2001-04-02 Thread David Balatero

Maybe after the UPDATE statement, you could do:

?php
header("Location: /path/to/other/script.php");
?

...but I don't know, I don't use header() that much.


-- David Balatero

-Original Message-
From: Jim Ray [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 6:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Auto load PHP


Is there a way, once updating a table to load another PHP? After, I have the
user click on the save button, the code calls a update routine. After the
UPDATE is done, I want the code to call another progam.


Thank you.

Jim



--
PHP Database 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 Database 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]