Hi everyone,
My hosting company have turned off register globals because of the security risk. I thought my forms would be fine, but now they are not working. Im told I need to change a few bits to Super Globals?... thats where im getting stuck.
Ive included the code from one of my forms, below, it just takes the information and puts it into the database.
So anyone that can help me get things working again would be great.
Thanks in advance
Lee
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "xxxxx", "xxxxx") or die("Could Not Connect To The Database. <br>" . mysql_error());
mysql_select_db("xxxxx",$db) or die("Could Not Select The Proper Database. <br>" . mysql_error());
$idesc = $_POST['idesc'];
$idate = $_POST['idate'];
$itotal = $_POST['itotal'];
$iwho = $_POST['iwho'];
$iwhoaddress = $_POST['iwhoaddress'];
$sql = "INSERT INTO gzinvoice(idesc, idate, itotal, iwho, iwhoaddress) VALUES ('$idesc','$idate','$itotal','$iwho','$iwhoaddress')";
$result = mysql_query($sql);
if($result)
{
echo "Data Properly Inserted";
}
else
{
echo "An Error occured while trying to process your information.";
print ("<br>" . mysql_error());
}
echo $sql ;
echo "Thank you! Information entered.\n";
}
else
{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<p>Management System</p>
</p>
<p>Date: <br>
<input name="idate" type="Text" id="idate">
</p>
<p>Name:
<br>
<input name="iwho" type="Text" id="iwho">
</p>
<p>Address: <br>
<textarea name="iwhoaddress" cols="80" rows="2" id="iwhoaddress"></textarea>
</p>
<p>
Description:<br>
<textarea name="idesc" cols="80" rows="5" id="idesc" input type="Text"></textarea>
<p> Invoice total:<br>
<input name="itotal" type="Text" id="itotal">
<p>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>