Display warnings with PHP

Asked

Viewed 226 times

0

I am making some scripts for a store and want to help with alerts, or better, messages that will be displayed after processing the forms. Want something more of the current type, would it be possible in PHP? Anyone help?

header("location:" . $_SERVER["HTTP_REFERER"]);
-> O AVISO/MENSAGEM SERIA AQUI <-
exit;
  • 7

    Have you considered using Javascript?

  • You can send the form in ajax and receive the return by json stating a message, this is also javascript.

  • today when signing me here on the site he showed a warning at the top, an orange bar with a phrase: Complete the registration for your account (X), this would help me.

1 answer

-3

Current Type... Jquery plugin Gritter, very practical:

See here

And here

Calls the plugin so:

<script type="text/javascript">google.load('jquery', '1.5');</script>    
<script type="text/javascript" src="js/jquery.gritter.js"></script>'

Then use it like this:

$.gritter.add( { title: 'Atenção!', text: 'Erro ao executar tarefa no servidor!', time: 7000, class_name: 'gritter-light', image: '/img/erro.png', });
  • 1

    While this link may answer the question, it is best to include the essential parts of the answer here and provide the link for reference. Replies per link only can be invalidated if the page with the link is changed.

  • They’re trying to do it, but since I’m new here I didn’t know how to comment with code, the previous comment was a bit messy, I’ll try again.

  • 1

    Click the [Edit] button and place it in the body of your answer

  • 1

    I transposed your comment to the body of your answer, see what can improve.

  • Just one question, wouldn’t it be the case to just make one alert() using the same JS?

  • I fixed the code, why did I lose so many points like that? It’s not just an Alert, as the question he wants something different!!

  • Actually I do not understand much of the languages in question, I asked just to try to understand. I think about the missing points is maybe there is some confusion in understanding the question.

  • If you do not understand the languages in question, how can you say that there was confusion? What I lacked was knowledge of the use of the forum tool and not the use of languages and the response that was run. Who takes those points so arbitrarily?

  • 2

    @Aragon negative votes are made by different users, each of the people who negatived or may have had a different reason, can I give you a few tips? The reason the majority was negative (these votes were not arbitrary) Regardless of your code is right in the functioning of it, the correct one would be to explain the use of combined redirection to a alert, what you did was just give an alternative to alert, another thing, we are not a forum, Stackoverflow is a Q&A platform, question and answer, so usually the answer has to be to the problem that the author is facing...

  • 2

    ... Which in this case is a problem working backend codes with frontend. I think this is the reason why so many negative votes, it is normal to happen this kind of thing, the negative votes are not evil they just express opinions. I hope you understand the platform of the community and perhaps you rephrase your answer (although I do not recommend it, because this question is a clear duplicate of http://answall.com/q/54345/3635 and for this reason it is not worth answering). Welcome to @Aragão, participate, in time you will understand the operation of Q&A Stackoverflow and ...

  • 1

    ... you won’t be able to use another kind of community

Show 6 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.