hey..
I need help with my php script..,, it's about allowing the user to insert a new entry and save it @ a table called"abc"..
the script:
**********
<?php
if(isset($_POST['submit']))
{
if((!empty ($_POST['title'])) && (!empty ($_POST['content'])) && (!empty ($_POST ['contentarea'])))
{
$dbc = @mysql_connect('localhost','root','1466');
@mysql_select_db('data');
$title = $_POST['title'];
$data1 = $_POST['content'];
$data2 = $_POST['contentarea'];
$query="INSERT INTO abc(id ,title,entry,data ,date_entered)
VALUES(0,'$title','$data1' ,'$data2',NOW())";
$do=@mysql_query($query);
}
else
{print '<p style="color: #556b2f; font-size:larger;">..please be sure you fill the records<a href="add-male.php"> BACK </a> </p>'; }
if($do)
{
print'<p style="color: #556b2f; font-size:larger;">thanks for adding <a href="male.php">
</a></p>';
mysql_close();
}
else
{print'<p>ERROR</p>';
}
}
else
{
print'
<p style="color: #8b0000; font-weight: bold; font-size:20px; text-align:right">add male:<br/>
<form action="add-male.php" method="post" >
<p style="color: #556b2f; font-size:larger;">male name:
<input type="text" name="title" size="20" /></p>
<p style="color: #556b2f; font-size:larger;">Quantities:</p>
<textarea name="content" rows="8" cols="50%"></textarea>
<br/>
<p style="color: #556b2f; font-size:larger;">method:</p>
<p><textarea name="contentarea" rows="8" cols="50%"></textarea></p>
<br />
<input type="submit" name="submit" value=" ADD " />
</p>
</form>';
}
?>
*****
thanks in advance
I need help with my php script..,, it's about allowing the user to insert a new entry and save it @ a table called"abc"..
the script:
**********
<?php
if(isset($_POST['submit']))
{
if((!empty ($_POST['title'])) && (!empty ($_POST['content'])) && (!empty ($_POST ['contentarea'])))
{
$dbc = @mysql_connect('localhost','root','1466');
@mysql_select_db('data');
$title = $_POST['title'];
$data1 = $_POST['content'];
$data2 = $_POST['contentarea'];
$query="INSERT INTO abc(id ,title,entry,data ,date_entered)
VALUES(0,'$title','$data1' ,'$data2',NOW())";
$do=@mysql_query($query);
}
else
{print '<p style="color: #556b2f; font-size:larger;">..please be sure you fill the records<a href="add-male.php"> BACK </a> </p>'; }
if($do)
{
print'<p style="color: #556b2f; font-size:larger;">thanks for adding <a href="male.php">
</a></p>';
mysql_close();
}
else
{print'<p>ERROR</p>';
}
}
else
{
print'
<p style="color: #8b0000; font-weight: bold; font-size:20px; text-align:right">add male:<br/>
<form action="add-male.php" method="post" >
<p style="color: #556b2f; font-size:larger;">male name:
<input type="text" name="title" size="20" /></p>
<p style="color: #556b2f; font-size:larger;">Quantities:</p>
<textarea name="content" rows="8" cols="50%"></textarea>
<br/>
<p style="color: #556b2f; font-size:larger;">method:</p>
<p><textarea name="contentarea" rows="8" cols="50%"></textarea></p>
<br />
<input type="submit" name="submit" value=" ADD " />
</p>
</form>';
}
?>
*****
thanks in advance