|
Posted by Vladimir Ghetau on 09/05/07 08:46
On Sep 4, 10:49 pm, JJM0926 <jjm0...@gmail.com> wrote:
> I've got a contact form with a submit button where users have to enter
> their support information. Some fields are required some are not.
> When I test out the form if I leave everything blank I get these two
> undefined index error :
.....
After looking at your code.... all I can say is:
<?php
if (condition) {
do_task_one();
} elseif (condition) {
do_task_two();
} else {
read_documentation();
}
?>
Here's what I would do at this point:
- while the application is tested, it's cool to have <?php
error_reporting(E_ALL); ?>, but when you're in production environment
(when people browse your site) <? error_reporting(0); ?> is
recommended to avoid revealing info about your code;
- instead of having
<?php
// ....
if isset($_POST['CurrentCustomer']) {
......
}
// ....
?>
I would go for:
<?php
//....
if (isset($_POST['CurrentCustomer'])) {
//....
}
?>
Also, make sure you change the email message building approach a
little bit, it allows people to inject "content-type" strings inside
your POSTS and easily deliver few hundred of emails to different
locations online.
Let me know how it goes!
Cheers!
Vladimir Ghetau
----------------------
http://www.Vladimirated.com
Navigation:
[Reply to this message]
|