Reposting form information

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wadesmart
Forum Commoner
Posts: 38
Joined: Sat Oct 02, 2004 10:10 pm
Location: US, Oklahoma
Contact:

Reposting form information

Post by wadesmart »

I have these fields Im testing for values. If they are not present then I show the field to insert the value but, if they are present I post what was put in. When the missing information is put in though, I want to resubmit all the information again. How can you do this? I thought the hidden field would work but, no.

Code: Select all

<?php
if(empty($_POST['Name'][$j])){
   $form_block .= '
     <li>Account Name: &nbsp; &nbsp; <input type="text" name="Name[]"> </li>
   ';
   $empty++;
  } 
else {
  $form_block .= '
    <li>Account Name: &nbsp; '.$_POST['Name'][$j].'</li>
    <input type="hidden" name="Name" value="'.$_POST['Name'][$j].'">
  ';
}
						
?>
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

your going to make this VERY complicated for yourself.
i would recomend just not accepting any info at all until its all complete
Post Reply