FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Newbie: Displaying a 'message box'
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Newbie: Displaying a 'message box' [message #169791 is a reply to message #169788] Sun, 26 September 2010 23:34 Go to previous messageGo to previous message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma:
Senior Member
On 9/26/2010 7:13 PM, Richard Holmes wrote:
> After a user has submitted a form I would like to display a message
> from a PHP function to acknowledge the input if the form is entered
> correctly or an error message if the input is incorrect. I've searched
> Google and the PHP manual but I haven't found an equivalent to a
> 'message box'. Any suggestions? TIA!
>
> Dick

Have the top of the page do a $msg = $_GET['msg']; and have the php
doing the processing send a ?msg=whatever_the_message_is after the page
name in the header("Location:......) directive.

Then, on your page you process that value using normal HTML (for example
as a textarea with readonly properties) or as the input to an inline
javscript that will put up an alert if there is some value received and
not be invoked at all if $msg is not set.

What I do is have a message at the top of the page, no surrounding box,
which is invoked only if $msg is set:

if (isset($msg)) echo $msg;

or

if (strlen($msg) > 0) echo $msg;

Of course you can put all that inside a <span></span> where you will
define print properties such as color, size, alignment, etc.

--
Shelly
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Array variable in echo statement
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 23:54:47 GMT 2024

Total time taken to generate the page: 0.04038 seconds