Re: mysql_connect noob question

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

 



On Fri, Apr 19, 2013 at 10:59 PM, Glob Design Info <info@xxxxxxxxxxxxxx>wrote:

> Already did that. I printed the form values in the PHP script after they
> are received and they print exactly as entered in the form. Even checked
> for extra spaces.
>
> Any functions I can pass the values to to remove the magic quotes?
>
> Thanks,


You would see the quotes if they were there in the output. There's no
reason why it should not work this way, though I doubt it's safe to do. Can
you show us the rest of the code, including the HTML form?
And exactly what error are you getting? (eg. from mysql_error())


>
>
> On 4/19/13 1:47 PM, Matijn Woudt wrote:
>
>> On Fri, Apr 19, 2013 at 10:43 PM, Glob Design Info <info@xxxxxxxxxxxxxx
>> >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,
>>>
>>>
>>>  Try printing the $form_user and form_pass values, it might be that it's
>> just an error elsewhere, maybe field name is different in the html?
>> Otherwise, it might be you have some php init setting, like magic quotes
>> that does something with the input data.
>>
>> - Matijn
>>
>>
>

[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