NYCPHP Meetup

How to proceed?

Tracy tech_learner at yahoo.com
Thu Feb 6 23:51:48 EST 2003


Hi,
the script below first presents a textbox for the user to enter a number. then it echoes itself and presents that many textboxes for the user to enter info.

after entering this info, i want the script to call another script where the processing is done which i am not able to get it happen. the same "user_run.php" seems to be toggling the entry fields.

How to set the action of the script to address the issue?

thankz
Tracy

####### user_run.php #########
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Test Network </TITLE>
</HEAD>

<BODY>

<?
foreach ($_POST as $k => $v) {
 $$k = $v;
 echo $k."=". $v;
}// echoes fine, flag = 1 on first run and flag = 2 on the second... so i guess the switch below isint being processed...

switch ($_POST[flag]) {
 case 1 : @header("Location: user_run.php"); 
  break;
 case 2: @header("Location: xor_run.php"); 
  break;
}
?>

<form method="post" action="">
<? 
if(!$_POST[tstcnt]) { 
 ?>
 How many test cases do u want to have ? 
 <input type="text" size="3" name="tstcnt" value=""> 
 <input type='hidden' name='flag' value =1 >
 <input type=submit value=Next>
 <?   
} 

else { 
 echo '<font color=blue>ENTER THE TEST CASES BELOW:</font>'."<br>\
";
 for ($i=1; $i<=$_POST[tstcnt]; $i++) {
  echo '<p>TEST CASE '.$i.' : ';
  echo '<input type="text" name="case'."$i".'" value="">'."<br>\
";
 }
 echo '<p><input type=submit value="test network">';
 echo '<p><input type="hidden" name="flag" value =2 >'; 
}
?>
</form>

</BODY>
</HTML>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coming together is a beginning... 
   keeping together is progress... 
      working together is success !!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030206/7c32dca8/attachment.html>


More information about the talk mailing list