php post
Posted: Wed Sep 28, 2011 1:13 pm
hello, i have a small problem with this code
The problem is that the post action will not even appear on the site, i log on my site and no thing happens, no post action there, can someone tell me is there something wrong with my code?
Code: Select all
<html>
<hr>
<?php
if (isset($_POST['post']))
{
$title = $_POST['title'];
$body = $_POST['body'];
if($title&&$body)
{
$connect= mysql_connect ("localhost","root","951623") or die ("error");
mysql_select_db ("phplogin") or die("table not found");
$date = date("Y-m-d");
$insert = mysql_query(" INSERT INTO news VALUES ('','$title','$body','$date')");
}
else
{
echo " Va rog umpleti toate casutele";
}
}
?>
<form action='post.php'method='POST'>
Titlul:<br>
<input type="text" name='title'><p>
Tutorial:<br>
<textarea rows='6' cols='70' name='body'></textarea><p>
<input type="submit" name="post" value="Post">
</form>
<hr>
</html>
The problem is that the post action will not even appear on the site, i log on my site and no thing happens, no post action there, can someone tell me is there something wrong with my code?