Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Same Code In 2 Different Pages Behaves Differently In Each

New Here ,
Sep 26, 2009 Sep 26, 2009

I have a series of three pages such that each, when submitted, calls the next one.  The first page calls the second one correctly, but the second one calls only itself.  Both are using the same code.

The form code for the first page is:

<form name="form1" method="post" onSubmit="return show_message();" action="<?php echo $_SERVER['PHP_SELF']; ?>">


At the top of the page is the following php script:

     In the first page (the one that works):

if (isset($_POST['submit']))
  {    
     echo '<META http-equiv="refresh" content="0;URL=WOTCPg2.php">';     // This works

//  header('Location: WOTCPg2.php');     // This was tried but didn't work
  }

?>
    

     When the Submit button is pressed, the above code displays the next page, as it should.

     The form code for the second page is:


    <form  method="post" name="QstnrPg1" id="QstnrPg1" action="<?php echo $_SERVER['PHP_SELF']; ?>">

     In the second page is the following php script:

   <?php
  
if (isset($_POST['submit']))
{    
//  header('Location: BlankIOD.php');     // this was tried but didn't work
  echo '<META http-equiv="refresh" content="0;URL=BlankIOD.php">';  // This doesn't work either (???)
} else
     Other code that executes (correctly) when the form loads

}


     When the Submit button here is pressed, the form simply refreshes itself.  I can't understand why this is happening, since both pages have essentially the same code.  Can anyone tell me what I'm missing or doing wrong?

TOPICS
Server side applications
401
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2009 Sep 28, 2009
LATEST

Well, I just discovered something.  Here's a reversal of one of my previous threads (i.e. ... Works in Live View but not on the server.  The second page (above) still doesn't work in my local server (xampp), but just for kicks, I uploaded it to my Yahoo site and guess what? It works there.  Go figure!  I'd really like to know why that would be the case, because it's certainly causing me a lot of confusion.  Are there some xampp settings somewhere that I need to check on?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines