Here i'm going to do a insert to the MySQL.but here i'm getting error.I saw there's a duplicated for the same but in those answers they asked to add ISSET.In my coding i added that also but still i'm getting this error.
Error 1 : Notice: Undefined index: Description in ....... add.php on line 8
Error 2 : Notice: Undefined variable: _FILE in ..........\add.php on line 9
Error 3 : Fatal error: Call to undefined function NOW() in ....add.php on line 12
Here i added my Coding below
<html>
<body>
<?php
include('config.php');
if(isset($_POST['submit']))
{
$Title=$_POST['Title'];
$Description=$_POST['Description'];
$Image = addslashes(file_get_contents($_FILE['Image']));
$Categories = $_POST['category'];
$ModifiedBy = 1;
$ModifiedDate = NOW();
$query1=mysql_query("insert into testdb values('','$Title','$Description','$Image','$Categories','$ModifiedBy',$ModifiedDate,1)");
if($query1)
{
header("location:list.php");
}
}
?>
<fieldset style="width:300px;">
<form method="post" action="" enctype="multipart/form-data">
Title: <input type="text" name="Title"><br>
Description: <input type="text" name="description"><br>
Image : <input type="file" name="Image" /><br>
<select name="category" id="category">
<option>Choose</option>
<option value="1">new</option>
<option value="2">info</option>
<option value="2">Event</option>
<br>
<input type="submit" name="submit">
</form>
</fieldset>
</body>
</html>