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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -