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

c# - Roxy file manager in MVC doesn't accept session path -

php - proc_open Too many open files in long running Symfony Console app -

c# - Show a huge number of data in DevExpress GridView -