You are here: Re: Undefine index error « PHP Programming Language « IT news, forums, messages
Re: Undefine index error

Posted by JJM0926 on 09/05/07 15:23

On Sep 5, 3:46 am, Vladimir Ghetau <vladi...@pixeltomorrow.com> wrote:
> 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

Vladimir,

When I try what you suggested I get the following:

Parse error: parse error, unexpected $end in E:\WebSites\mywebsite\www
\contactus_revised.php on line 402

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация