Location: PHPKode > projects > RecipeNet > add.php
<?php $sitesection="Add A Recipe"; include 'header.php';
echo '<p align="center"><strong>Add A Recipe</strong></p>'; if ($_GET['step'] < '0') { ?>
<p align="center">&nbsp;</p>
<form name="form1" method="post" action="add.php?step=2">
  <p>Recipe Name: 
    <input type="text" name="rname">
</p>
  <p>Submitted By: 
    <input type="text" name="rsb" /> 
    Original Creator: 
    <input type="text" name="rcb" />
  </p>
  <p>Number of Ingredients: 
    <input name="rnuming" type="text" size="10" maxlength="10" /> 
    Number of <strong>main</strong> ingredients: 
    <input name="rnumain" type="text" size="10" maxlength="10" />
  </p>
  <p>Type of food: 
    <input type="text" name="rgenre" />
  </p>
  <p>Level (easy, medium, hard): 
    <input type="text" name="rlevel" /> 
    Approx. Time (Minutes): 
    <input type="text" name="rtime" />
  </p>
  <p><textarea name="ring" cols="50" rows="15">Type the ingredients here.</textarea></p>
  <p><textarea name="rtxt" cols="50" rows="15">Type the recipe here.</textarea>
    <input type="submit" name="Submit" value="Submit" />
  </p>
  
</form>
<?php
}
if ($_GET['step'] == '2') {
$rname=$_POST['rname']; 
$rsb=$_POST['rsb']; 
$rcb=$_POST['rcb']; 
$rnuming=$_POST['rnuming']; 
$rnumain=$_POST['rnumain']; 
$rgenre=$_POST['rgenre']; 
$rlevel=$_POST['rlevel']; 
$rtime=$_POST['rtime']; 
$ring=$_POST['ring']; 
$rtxt=$_POST['rtxt'];
$iq="insert into `rn_recipes` ( `id`, `name`, `submit`, `creator`, `numing`, `numain`, `genre`, `level`, `time`, `ing`, `text` ) values (  '',  '$rname',  '$rsb',  '$rcb',  '$rnuming',  '$rnumain',  '$rgenre',  '$rlevel',  '$rtime',  '$ring',  '$rtxt' )";
mysql_connect($dbhost,$dbuser,$dbpass);
@mysql_select_db($db) or die( "Unable to select database");
mysql_query($iq);
mysql_close();
echo 'Your Recipe has been added to our database.  <a href="index.php">Home</a>';
echo '</body></html>';
}
?>
</body></html>
Return current item: RecipeNet