NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to proceed?

Ernesto Guerrieri ernesto at guerrieri.us
Mon Feb 10 11:15:45 EST 2003


Tracy,

I don't think the redirect will work until you comment out the echo
statement - You can't have any output in order to re-direct.

Ernesto
---
Tracy wrote:
> 
> 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
> 
> --- Unsubscribe at http://nyphp.org/list/ ---



More information about the talk mailing list