View Single Post
Join Date: Jan 2009
Posts: 1,267
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 159
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: php code to search and show results on same page

 
0
  #7
Jan 8th, 2009
Logial Correction, and statement of the obvious
  1. <?php
  2. /*
  3. logical construct depends on your data,,,
  4. validate data entries,
  5. if valid
  6.  insert to mysql,
  7.  disable submit so data will not be aded to table twice,
  8.  or redirect to another page
  9. else
  10.  echo feedback to user to explain what is right/wrong with the submitted data before the form is resubmitted
  11. */ ?>
  12. <form action='<?php iecho $_SERVER['PHP_Self']; ?>'>
  13. <input type='text' name='field1' value='<?php if(isset($field1)){echo $field1; } ?>'>
  14. <input type='text' name='field2' value='<?php if(isset($field2)){echo $field2; } ?>'>
  15. <input type='text' name='field3' value='<?php if(isset($field3)){echo $field3; } ?>'>
  16. <input type='text' name='field4' value='<?php if(isset($field4)){echo $field4; } ?>'>
  17. <input type='submit' onclick="return confirm('Are all fields complete?')">
Last edited by almostbob; Jan 8th, 2009 at 11:50 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Please mark solved problems, solved
Reply With Quote