Reply to Re: header() with if/then statements

Your name:

Reply:


Posted by e_matthes on 11/17/06 20:07

> I appreciate the help. I think the concept is getting clearer. I am
> just curious though. The first time a person loads the webpage wouldn't
> the php execute and since all of the variables are null, wouldn't it
> automatically display an error message even before the person has had a
> chance to fill out the form?

The structure of my pages looks like this:

<?php // Very first thing, so header redirects work

// Initialize variables that appear in html, so they are empty, not
null

if ($_POST) {
// validate & process data
}

?>

<html>
web content
</html>


The if ($_POST) prevents any validation from being done until the user
has submitted some data. It is common for many people not to bother
initializing the variables, but if you look at your html output, it's
pretty ugly with a bunch of "uninitialized variable" messages in the
code. This all works for me locally, but I haven't gone live with it
yet. Am I missing anything?

[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

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