Re: Submitting data to MySQL database using HTML/PHP form
| From: | Daniel Brown | Date: | Sun, 20 Feb 2011 18:00:01 +0000 |
| Subject: | Re: Submitting data to MySQL database using HTML/PHP form | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311462@lists.php.net to get a copy of this message | ||
On Sun, Feb 20, 2011 at 12:55, Daniel Brown <danbrown@php.net> wrote:
> On Sun, Feb 20, 2011 at 12:53, Daniel Brown <danbrown@php.net> wrote:
>>
>> If the value isn't that of your database password, there's your
>> problem: register_globals. A simpler way is to check the output of
>> phpinfo(); to see if register_globals is enabled, but either method
>> will work.
>
> Actually, disregard my answer: I misread your original email about
> where each line of code was placed. My answer is not correct in this
> case.
Does your login.php file actually use the following closing tag: >?
If so, that's backwards, which will cause a parse error on
login.php. Closing tags should be ?>, but if it's the last line in a
file, you can safely (and perhaps should) omit them.
Also, some other pointers:
* ALWAYS sanitize user input. At the very least, look into
mysql_real_escape_string().
* Don't use the same variable name for multiple things unless
you need to do so. It makes debugging more difficult in complex
scripts.
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/