NYCPHP Meetup

NYPHP.org

How to proceed?

luismorales at juntos.com luismorales at juntos.com
Fri Feb 7 16:03:42 EST 2003


I have an litle solution here.....

<!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;
}
?>

<? if ($_POST[submit] == "test network") { ?>
   <br>Put here the post form code process ...
   
<? }else{?>

   <form method="post" action="<?= $_SERVER['PHP_SELF'] ?>" 
ENCTYPE="multipart/form-data"">
  <? 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 { ?>
   <font color=blue>ENTER THE TEST CASES BELOW:</font>"<br>
      <? for ($i=1; $i<=$_POST[tstcnt]; $i++) { ?>
          <p>TEST CASE <?=$i?> : 
          <input type="text" name="case<?=$i?>" value=""><br>
      <? } ?>
   <p><input type=submit value="test network" name="submit">
   <p><input type="hidden" name="flag" value =2 >
   <?}?>
</form>

<? } ?>

</BODY>
</HTML>



Quoting Tracy <tech_learner at yahoo.com>:

> 
> 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





More information about the talk mailing list