Re: [PHP-DB] Issue 45979: PHP code attached

[email protected] (Chris)
Newsgroups php.db
Message-ID <[email protected]>
>         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.


> 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.

I was suggesting that was the cause of the problem (no post variables). 
I'd ask a user for the details during an install phase of an app, but 
that's it.

-- 
Postgresql & php tutorials
http://www.designmagick.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.