Re: Issue 45979: PHP code attached
| From: | Bastien Koert | Date: | Mon, 23 Feb 2009 02:59:26 +0000 |
| Subject: | Re: Issue 45979: PHP code attached | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45992@lists.php.net to get a copy of this message | ||
On Sun, Feb 22, 2009 at 4:43 PM, Chris <dmagick@gmail.com> wrote:
>
> This is the page called
>> ~~~~~~~~~~~~~~~~~~~~~~~
>>
>> <?php
>> #phpinfo(); # phpinfo displays the correct info.
>> #exit;
>>
>> $sqldb = $_POST["sqldb"];
>> $sqluser = $_POST["sqluser"];
>> $sqlpass = $_POST["sqlpass"];
>> $sqlhost = $_POST["sqlhost"];
>>
>> $link = mysql_connect($sqlhost, $sqluser, $sqlpass);
>>
>
> What happens if I somehow hit the page directly instead of through the
> previous page's form? There are no $_POST variables.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Then you would need to redirect the user to the form page to get the data
from the user. Or create an application account that the rest of the
application would use. Frankly there is no way that I would ever ask the
user for the credentials, if they need different user accounts, I would
create each one on the server and allow the application to control what
accounts are used.
--
Bastien
Cat, the other other white meat