Jump to content

Page does not respond to POST to itself


trafico

Recommended Posts

Hi,

 

I developed my page at home, on a home server, now I am putting it on the web,

 

I am using a normal post, so that the values will be posted onto itself for testing.

 

 

<form id="form1" name="form1" method="post" action="thispage.php">

 

 

Is works find at home, but when I put it on the web it does not!

 

What happens: the page appears good, when I click submit, the page goes blank. What should happen is, it should get redirected to next page or show itself.

 

Somthing is not correct, has anyone meet this before?

Link to comment
Share on other sites

Thanks :)

 

<form id="form1" name="form1" method="post" action="test.php">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><table width="745" border="0" cellpadding="5" cellspacing="0">
        <tr>
          <td width="120" class="FieldName">Email Address</td>
          <td width="375"><input name="Txt1" type="text" class="FieldValue" id="Txt1" value="<?PHP echo $InputFromScreen[1]; ?>" size="50" maxlength="50"/></td>
          <td width="220" class="FieldNote"> </td>
        </tr>
        <tr>
          <td class="FieldName">Password</td>
          <td><input name="Txt2" type="password" class="FieldValue" id="Txt2" value="" size="30" maxlength="30"/></td>
          <td class="FieldNote"> </td>
        </tr>
        <tr>
          <td class="FieldValue"> </td>
          <td class="PHPRunTime"><?PHP
		//Checking for Unfilled Fields
		$TxtBoxesNotFullyFilled=0;
		for ($i=1; $i<=$NumberOfTxtBoxesMustBeFilled; $i++)
		{
			if ($InputFromScreen[$i]=="")
			{
				$TxtBoxesNotFullyFilled=1;
				break;	
			}
		}	
		if ($TxtBoxesNotFullyFilled==1)
		{
			echo "All Fields Should be Filled!";
		}
		else
		{
			$_SESSION['ses']=$InputFromScreen[1];
			header("location: nextpage.php");
		}	
		?>
          </td>
          <td class="FieldNote"> </td>
        </tr>
        <tr>
          <td height="33" class="FieldValue"> </td>
          <td><input onclick="return count()" name="Submit" type="submit" class="FeildButton" id="Submit" value="Submit" />
          </td>
          <td class="FieldValue"> </td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
</form>

Link to comment
Share on other sites

Thanks :)

<?php
ob_start();
session_start();
$_SESSION['ses']=0;
?>
<body>
<?PHP
$NumberOfTxtBoxes=2;
$NumberOfTxtBoxesMustBeFilled=2;

if (isset($_POST['Submit'])) 
{
for ($i=1; $i<=$NumberOfTxtBoxes; $i++)
{
	$InputFromScreen[$i]=($_POST["Txt".$i]);
}
}
else
{
for ($i=1; $i<=$NumberOfTxtBoxes; $i++)
{
	$InputFromScreen[$i]="";
}
}
?>
<form id="form1" name="form1" method="post" action="test.php">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><table width="745" border="0" cellpadding="5" cellspacing="0">
        <tr>
          <td width="120" class="FieldName">Email Address</td>
          <td width="375"><input name="Txt1" type="text" class="FieldValue" id="Txt1" value="<?PHP echo $InputFromScreen[1]; ?>" size="50" maxlength="50"/></td>
          <td width="220" class="FieldNote"> </td>
        </tr>
        <tr>
          <td class="FieldName">Password</td>
          <td><input name="Txt2" type="password" class="FieldValue" id="Txt2" value="" size="30" maxlength="30"/></td>
          <td class="FieldNote"> </td>
        </tr>
        <tr>
          <td class="FieldValue"> </td>
          <td class="PHPRunTime"><?PHP
		//Checking for Unfilled Fields
		$TxtBoxesNotFullyFilled=0;
		for ($i=1; $i<=$NumberOfTxtBoxesMustBeFilled; $i++)
		{
			if ($InputFromScreen[$i]=="")
			{
				$TxtBoxesNotFullyFilled=1;
				break;	
			}
		}	
		if ($TxtBoxesNotFullyFilled==1)
		{
			echo "All Fields Should be Filled!";
		}
		else
		{
			$_SESSION['ses']=$InputFromScreen[1];
			header("location: nextpage.php");
		}	
		?>
          </td>
          <td class="FieldNote"> </td>
        </tr>
        <tr>
          <td height="33" class="FieldValue"> </td>
          <td><input onclick="return count()" name="Submit" type="submit" class="FeildButton" id="Submit" value="Submit" />
          </td>
          <td class="FieldValue"> </td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.