I like to post to self.
A general outline of a simple form script goes like this:

<?php

// include config file or other functions needed

include("_header.php");
if ($_SERVER['REQUEST_METHOD'] == "GET") {


// display a blank form display_form();

} else if ($_SERVER['REQUEST_METHOD'] == "POST") {

// process the posted input and display result

}
include("_footer.php");
exit;

// define any functions specific to this file here

?>

The result is that a simple link to the page will run the "GET" branch of the page and essentially show a static page. That page would then "POST" back to itself, running the "POST" branch, processing the form input and displaying a results page.

The header and footer files could be static .html files but sometime you want to do dynamic stuff with the page title or navigation so I've shown them as .php.


Sheila -- Sheila Fenelon [EMAIL PROTECTED] http://www.shefen.com/ San Marcos, Texas



[EMAIL PROTECTED] wrote:
My question is which format is better (preferred) - post to self or post to
an external php script.
I use both and would like to be a little more consistent and standard.
I like the post to self - however refresh gives me problems but the result
is fewer files.
Working with a separate script makes it easier to make changes to the form
and the script.
My project involves many php scripts and do not want to paint myself into a
corner.
Any thoughts, logic or opinions are welcome.
TIA :-)
Regards

Loren Wolsiffer

"When free speech is outlawed, only criminals will complain."



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub


________________ http://www.wdvl.com _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.



Reply via email to