I am working on a snippet of code recycled from another location and the original works fine but the modified one just gives me a blank page. I have tried commenting out sections in hopes of isolating the problem but I keep hitting a road block. I know it is something simple and something I am overlooking but I my brain hurts now and figured I would post it on here while I went outside to scream at passing cars to relieve some frustration.
<TITLE> Add Item </TITLE>
<?php
include("dbc.php");
if(isset($_POST['submit']))
{
$material = $_POST['material'];
$dimmention = $_POST['dimmention'];
$size = $_POST['length'];
$color = $_POST['color'];
if(!$material)
{
echo "Error: Material is a required field. Please fill it.";
exit();
}
$result = mysql_query("INSERT INTO list (mat, date, dim, size, color)
VALUES ('$material',NOW (),'$dimmention','$size','$color')",$connect);
echo "<b>Thank you! Item added Successfully!<br>You'll be redirected to Home Page after (4) Seconds";
echo "<meta http-equiv=Refresh content=4;url=index.php>";
}
else
{
?>
<br>
<h3>::Add Item</h3>
<form method="post" action="<?php echo $_SERVER[PHP_SELF] ?>">
Material (Alum, Galv, Steel): <input name="material" size="6" maxlength="6">
<br>
Dimentions (1 x 2 Patio, 2 x 2 090): <input name="dimmention" size="50" maxlength="100">
<br>
Size (24, 30, 15): <input name="length" size="5" maxlength="5">
<br>
Color (bronze, white, MF): <input name="color" size="6" maxlength="6">
<br>
<input type="submit" name="submit" value="Add Item">
</form>
<?
}
?>
Thanks to all who can help.