Reply to Re: Undefine index error

Your name:

Reply:


Posted by Csaba Gabor on 09/05/07 09:53

On Sep 4, 11: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 :
>
> Notice: Undefined index: CurrentCustomer in E:\WebSites\mysite\www
> \contactus.php on line 9
>
> Notice: Undefined index: ContactMethod in E:\WebSites\mysite\www
> \contactus.php on line 19
>
> If I fill out at least the required fields everything is fine.
>
> Here's what the code looks like:
>
> <?php
> if (isset($_POST["Submit"])) // Trigger
> { ... }
> if isset($_POST['Name']) {
> $message = $message."Name: ".$_POST['Name']."\n";
> }
> ...
> ?>

In place of isset, sometimes it's useful to use:
http://php.net/array_key_exists

Csaba Gabor from Vienna

[Back to original 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

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