javascript - PHP can I kill the script and have an alert? -


I want to kill a script and post a warning on the same page

My code:

  if (empty ($ _ POST ['item'])) {print '& lt; Script type = "text / javascript" & gt; '; Print 'alert ("item is required"); Print '& lt; / script & gt; '; }   

The problem is that the script does not kill

is there a way to do that it kills the script, prints, and stops the same Page?

Use

  Exit zero ([string $ Status]]   

or

  Exit zero (int $ position)   < P> To end your current  php  script.   

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -