Re: Self calling PHP

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

 



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: signature.asc
Description: OpenPGP digital signature


[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