Hey I'm Trying To add some data in my table through a form .
But the form is not working or somethings wrong with my PHP code .
This is the HTML
<form action="upload.php" method="post" enctype="multipart/form-data" name="subform" id="subform" class="forms" role="form" >
<label>
<input name="title" id="title" type="text" class="form-control" placeholder="put the title here">
</label>
<label>
<input name="singer" id="singer" type="text" class="form-control" placeholder="Artist / Band">
</label>
<label>
<input name="songname" id="songname" type="text" class="form-control" placeholder="Song Name">
</label>
<label>
<input name="lyrics" id="lyrics" type="text" class="form-control" placeholder="Lyrics">
</label>
<label>
<input name="arrange" id="arrange" type="text" class="form-control" placeholder="Arrangement By ?">
</label>
<label>
<input name="channel" id="channel" type="text" class="form-control" placeholder="Channel">
</label>
<label>
<input name="dllink" id="dllink" type="text" class="form-control" placeholder="Download Link">
</label>
<label>
<select name="category" id="category" class="form-control">
<option>Pop</option>
<option>Rock</option>
<option>Rap</option>
<option>Classic</option>
</select>
</label>
<label><input name="cover" id="cover" type="file" class="form-control"
placeholder="Cover"></label>
<div class="submit-btn">
<input type="submit" class="Btn_submit" id="submit" name="button" />
</div>
</form>
And This is The PHP :
if(isset($_POST['title'])){
$title = mysql_real_escape_string($_POST['title']);
$category = mysql_real_escape_string($_POST['category']);
$singer = mysql_real_escape_string($_POST['singer']);
$songname = mysql_real_escape_string($_POST['songname']);
$arrange = mysql_real_escape_string($_POST['arrange']);
$lyrics = mysql_real_escape_string($_POST['lyrics']);
$dllink = mysql_real_escape_string($_POST['dllink']);
$channel = mysql_real_escape_string($_POST['channel']);
$sql = mysql_query("INSERT INTO songs (title, category, singer, sname, arrangement, lyrics, download, channel, reldate) VALUES('$title','$category','$singer','$songname',$arrange','$lyrics','$dllink','$channel',now())");
$sid = mysql_insert_id();
$newname = "$sid.jpg";
move_uploaded_file($_FILES['cover']['tmp_name'], "../covers/$newname");
header("location: upload.php");
}
Do You know What i'm doing wrong here ?
i've done this before with no problems .
but it seems like i'm forgetting something this time .