Re: mysql_connect noob question
| From: | Tedd Sperling | Date: | Sat, 20 Apr 2013 12:46:03 +0000 |
| Subject: | Re: mysql_connect noob question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320908@lists.php.net to get a copy of this message | ||
On Apr 19, 2013, at 4:43 PM, Glob Design Info <info@globdesign.com> wrote:
> I know this has probably been answered already.
>
> When I pass a user name and password from a form to my PHP script and then pass those to
> mysql_connect it doesn't connect. When I paste those exact same values into mysql_connect as
> string literals it works.
>
> Can anyone tell me why this happens?
>
> I know the strings are identical to the literals I try in a test but they don't work when
> submitted via form.
>
> $form_user = $_POST[ 'user' ];
> $form_pass = $_POST[ 'password' ];
>
> # Connect to remote DB
>
> $LINK = mysql_connect( $host, $form_user, $form_pass );
>
> And yes, my $host param is correct.
>
> Thanks,
Why are you allowing anyone to connect to your database from a form?
Cheers,
tedd
_____________________
tedd.sperling@gmail.com
http://sperling.com