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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -