Re: Self calling PHP

From: Date: Tue, 01 Mar 2005 20:47:14 +0000
Subject: Re: Self calling PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209735@lists.php.net to get a copy of this message
Phillip Armitage wrote: > I'm working on an ftp login form using PHP. I'm trying to set it up so that > the PHP file is self calling. eg. file FTP.PHP displays an html form in > which the form action setting calls FTP.PHP. Essentially the program does > the following: > ... The $_REQUEST array is rebuilt on every request. It sounds to me like you need to look into storing user info in sessions: http://php.net/manual/en/ref.session.php So basically your user submits user / pw info on the first request and if the authentication succeeds you can start a session for the user. > > Does PHP support the writing of scripts which with forms whose actions are > self calling? eg. the form created by ftp.php calls ftp.php. Absolutely! The lazy man's way of doing this: /** HTML File */ <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> /** PHP File */ echo "<form action=\"{$_SERVER['PHP_SELF']}\" method=\"POST\">"; > > If so, is there anything I need to do to flush the $_REQUEST buffer between > presses of the SUBMIT button? It is flushed on *every* request. $_REQUEST is "stateless" meaning that it doesn't remember what the user passed through the browser on the last SUBMIT. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.general (#209735) next »