Posted By

kylebruns on 08/27/12


Tagged


Versions (?)

Problem PHP script


 / Published in: PHP
 

Trying to resolve without Global Variables.

  1. <?php
  2. $validation = array();
  3.  
  4. if (!$_POST['email']) {
  5. array_push ('email', $validaton);
  6. }
  7.  
  8. if (!$_POST['phone']) {
  9. array_push ('phone', $validaton);
  10. }
  11. ?>
  12.  
  13. <body>
  14. <?php if(in_array('email', $validation)): ?><span class="error"><?php echo 'Please enter an email address'; ?></span><?php endif; ?>
  15. </body>

Report this snippet  

You need to login to post a comment.