Re: [PHP] mysql_connect noob question
[email protected] (tamouse mailing lists)
| Newsgroups | php.general |
|---|---|
| Message-ID | <CAHUC_t-g9FJjsOFaPPqM0Ub1cikMJAMvnnpnXA4_6pAE4a4Wiw@mail.gmail.com> |
On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info <[email protected]> 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, So, um, look at this gist: https://gist.github.com/tamouse/5430012 I know this never helps, but 'Works for me!'