Soldato
- Joined
- 10 Apr 2006
- Posts
- 7,890
- Location
- North West
When i click the submit button i get this error:
Not Found
The requested URL /my ver/< was not found on this server.
Here is the HTML of the page, i think its an error in the form but not sure as I'm new to php/mysql.
Any help to why i get this will be very appreciated, need to get this fixed by tonight can I can't think why it's doing this
and the php:
Not Found
The requested URL /my ver/< was not found on this server.
Here is the HTML of the page, i think its an error in the form but not sure as I'm new to php/mysql.
Any help to why i get this will be very appreciated, need to get this fixed by tonight can I can't think why it's doing this
Code:
<div id="MainContent">
<h1>Edit Sweet</h1>
<div id="EditSweetContent">
<div id="Edit_Sweet">
<h1><?php echo $row["sName"]; ?> <br/></h1>
<?php
echo "<form method='post' action='<?php echo $PHP_SELF;?>'>";
echo "Sweet Name:<br/><input type='text' name='sName' value='" . $row['sName'] . "' size='60%' /></input><br/>";
echo "Sweet Category:<br/><input type='text' name='sCategory' value='" . $row['sCategory'] . "' size='60%' /></input><br/>";
echo "Short Description:<br/><input type='text' name='sShortDesc' value='" . $row['sShortDesc'] . "' size='60%' /></input><br/>";
echo "Long Description:<br/><textarea rows='10' cols='59' name='sLongDesc' wrap='physical' size='60%'>" . $row['sLongDesc'] . "</textarea><br/>";
echo "Price:<br/><input type='text' name='sPrice' value='£" . $row['sPrice'] . "' size='60%' /></input><br/>";
echo "Price Per:<br/><input type='text' name='sPriceper' value='" . $row['sPricePer'] . "' size='60%' /></input><br/>";
echo "Picture:<br/>";
$query = "SELECT DISTINCT * FROM `sweets`";
$results = mysql_query($query);
$row = mysql_fetch_array($results);
echo "<select>";
while($row = mysql_fetch_array($results))
{
echo "<option>" . $row['sImgName'] . "</option>";
}
echo "</select><br/>";
echo "Stock Level:<br/><input type='text' value'" . $row['sStock'] . "' size='auto' /></input><br/><br/>";
echo "<input type='submit' value='Submit Edited Sweet' name='submit'></input>";
echo "</form>";
?>
<br/>
</div>
</div>
</div>
and the php:
PHP:
<?php
require("functions.php"); //Gets all the functions
dbConnect(); //Connects to the database
html_sec("header"); //Adds Header tags for HTML
$query = "SELECT * FROM `sweets` WHERE uid = {$_GET['id']}";
$results = mysql_query($query);
$row = mysql_fetch_array($results);
$uid = $_POST['uid'];
$sName = $_POST["sName"];
$sCategory = $_POST["sCategory"];
$sShortDesc = $_POST["sShortDesc"];
$sLongDesc = $_POST["sLongDesc"];
$sPrice = $_POST["sPrice"];
$sPricePer = $_POST["sPricePer"];
$sStock = $_POST["sSTock"];
$sGelatinFree = $_POST["sGelatinFree"];
$sSugarFree = $_POST["sSugarFree"];
$sGlutenFree = $_POST["sGlutenFree"];
?>