Jump to content

keeps loading same page


jack_wetson

Recommended Posts

when i run this script i just keep getting the form coming up and nothing being posted to the database

 

<html>
<body>
<?php

if ($submit) {

//process form
$db = mysql_connect("*****","*****","*****");
mysql_select_db("silversi_orders",$db);
$sql = "INSERT INTO `ebay` (`ebayID`, `itemID`, `itemDes`, `email`, `Telephone`, `Status`) VALUES ('$ebayID', '$itemID', '$itemDes', '$email', '$Telephone', 'Ordered')";
$result = mysql_query($sql);
  echo "Thank You, Your Order Is Now Being Processed.\n"; ?> <br> <a href="http://www.silversidegaming.info"> Go back To The Homepage </a> <?php
} else {
  //display form
  ?>
<form method="post" action="<?php echo $PHP_SELF ?>">
Ebay Transaction ID:<input type="Text" name="ebayID"><br>
Item ID:<input type="Text" name="itemID"><br>
Item Description:<input type="Text" name="itemDes"><br>
E-mail:<input type="Text" name="email"><br>
Telephone:<input type="Text" name="Telephone"><br>
<input type="Submit" name="submit" value="Process Ebay Transaction">
</form>
<?php
} //end if
?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/92716-keeps-loading-same-page/
Share on other sites

can you give an example , sorry im new to all of this :)

 

code at this point:_

 

<html>
<body>
<?php

if (isset($_POST['submit'])) {

//process form
$db = mysql_connect("localhost","*****","****");
mysql_select_db("silversi_orders",$db);
$sql = "INSERT INTO `ebay` (`ebayID`, `itemID`, `itemDes`, `email`, `Telephone`, `Status`) VALUES ('$ebayID', '$itemID', '$itemDes', '$email', '$Telephone', 'Ordered')";
$result = mysql_query($sql);
  echo "Thank You, Your Order Is Now Being Processed.\n"; ?> <br> <a href="http://www.silversidegaming.info"> Go back To The Homepage </a> <?php
} else {
  //display form
  ?>
<form method="post" action="<?php echo $PHP_SELF ?>">
Ebay Transaction ID:<input type="Text" name="ebayID"><br>
Item ID:<input type="Text" name="itemID"><br>
Item Description:<input type="Text" name="itemDes"><br>
E-mail:<input type="Text" name="email"><br>
Telephone:<input type="Text" name="Telephone"><br>
<input type="Submit" name="submit" value="Process Ebay Transaction">
</form>
<?php
} //end if
?>
</body>
</html>

<html>
<body>
<?php

if (isset($_POST['submit'])
{

//process form
$db = mysql_connect("*****","*****","*****");
mysql_select_db("silversi_orders",$db);
$sql = "INSERT INTO `ebay` (`ebayID`, `itemID`, `itemDes`, `email`, `Telephone`, `Status`) VALUES ('".$_POST['ebayID']."', '".$_POST['itemID']."', '".$_POST['itemDes']."', '".$_POST['email']."', '".$_POST['Telephone']."', 'Ordered')";
$result = mysql_query($sql);
echo "Thank You, Your Order Is Now Being Processed.\n <br> <a href=\"http://www.silversidegaming.info\"> Go back To The Homepage </a>";
}
else
{
  //display form
  ?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Ebay Transaction ID:<input type="Text" name="ebayID"><br>
Item ID:<input type="Text" name="itemID"><br>
Item Description:<input type="Text" name="itemDes"><br>
E-mail:<input type="Text" name="email"><br>
Telephone:<input type="Text" name="Telephone"><br>
<input type="Submit" name="submit" value="Process Ebay Transaction">
</form>
<?php
} //end if
?>
</body>
</html>

 

Orio.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.