You are here: Re: Log and Error/Info Message class « PHP Programming Language « IT news, forums, messages
Re: Log and Error/Info Message class

Posted by Dikkie Dik on 12/15/05 21:12

There are a few things to consider. From your story, I understand that
you just want a message passed to the user. You could store it in the
session, but I see no need. A log is more useful if you want to store
the message to be seen by the admin at a later time.

If you want to display the message, I understand that the redirection
cannot take place. So no redirection headers will be sent if you want to
show the user the message. That is why I think there is no need to store
anything if you only want to show it to the user. If you want to show it
to the admin, it is off course wise to store or e-mail it.

If you use a META tag to do the redirection, you can give a time to wait
before the redirection, so you can redirect and pass a message without
much difficult programming.

I do not know what you want exactly, but if it is your own page you
redirect to, you can consider posting to the same page that contained
your form and show the form if no valid input was found, with messages
if invalid input was present, and the results if the input was valid.

Best regards

Angelos wrote:
>> Other than that I am not sure what you are looking for, do you want to
>> show errors that php generates? Do you want to inform the user if a
>> query was successful or not? What are these errors that are being
>> generated?
>>
> What I want is to inform users that
> - a query was succesfully competed
> - the login details they entered were wrong
> - that an image was uploaded succesfully
> ....
> - And all this usefull messages that a script can generate.
>
> Ofcourse I am able to do that really easy but if I want to redirect at
> the same time then I need to store that message somewhere and after the
> redirection, display it.
> Also I need to display all the messages in a specific div inside my page.
> That means that my index.php page has a div like that:
> <div id="status">
> $log = new $log();
> $log->displayStoredMessage();
> </div>
>
> And my class that handles the queries look like that:
>
> $result = mysql_query("SELECT * FROM cms_users WHERE cms_user_email =
> '".$email."' AND cms_user_passwd = '".$password."'") or die(mysql_error());
> $num_rows = mysql_num_rows($result);
> ...
> if($num_rows == 1)
> return true;
> else
> {
> $log=new log();
> $log->Log('Message','Invalid Login, please make sure you
> enter your Email and Password.<br>If you forgot your
> password, enter your email and hit the forgot password button.');
> }

 

Navigation:

[Reply to this 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

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