Re: Hiding text?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Stokes wrote:
Hello,

How can I hide error message when user enters to POST action form for first time? I have a form for collecting and saving user data. In the code below you can see that there are text messages for user info stored in $teksti variables. At the end the $teksti is passed to function that displays the message. Problem is that when user enters the page for firs time the variables are empty and therefore basically the decisions made with variable values result to error message at the first time.

Thanks for your advice
-Will

Here's code:


..

UserMessage ($teksti);

try something like:

if (isset($teksti) && $teksti) {
	UserMessage ($teksti);
}

also note you check for the existance of the $_POST
superglobal to determine if the user actually submitted a post.
e.g.:

if (isset($_POST) && is_array($POST) && !empty($_POST)) {
	// somebody submitted something from somewhere.
}



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux