Reply to Re: Form Validation

Your name:

Reply:


Posted by Tim Van Wassenhove on 04/07/07 07:58

Jerim79 schreef:
> Here is my form:
>
> <?php
> $Number;
> $Email;

That's obosolete.. These days you get your input from the $_* arrays.
(And later on you'll probably get it from the input_* functions)

> if (empty($Number)){

if (isset($_POST['Number'])) {

> echo "<form action=\"{$_SERVER['PHP_SELF']}\" method=\"POST\">

Using $_SERVER['PHP_SELF'] leads to security problems.. You can achieve
the same result using '#' as action.

<form action='#' method='post'>

> This works fine in that it catches what it needs to catch. However,
> obviously, it prints out the error message upon first loading the
> page.

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// the user posted something, process the form...
} else {
// the user getted something, display the form...
}



--
Tim Van Wassenhove <url:http://www.timvw.be/>

[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

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