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

Link to comment
Share on other sites

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

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.