Hi,
I have designed a simple database insert script to submit movie reviews to our website, however, to make it easier for the staff to add images I was hoping to have an image upload function with the script which will send the image to a folder named images/movies and input the url to the database? Here is the code I have at the moment:
<fieldset class="fieldset"><legend><span class="Header">Add New Movie:</span></legend>
<div class="div">
<div align="right">
<form action="moviescomedysubmit.php" method="post">
Your Name:
<input name="movieby" type="text" size="30" maxlength="50" />
<br />
Movie Name:
<input name="moviename" type="text" size="30" maxlength="100" />
<br />
Director:
<input name="moviedirector" type="text" size="30" maxlength="100" />
<br />
Starring:
<input name="moviestarring" type="text" size="30" maxlength="100" />
<br />
Release Date:
<input name="movierelease" type="text" size="30" maxlength="100" />
<br />
Run Time:
<input name="movieruntime" type="text" size="30" maxlength="100" />
<br />
Short Synopsis:
<textarea name="movieshort" type="text" cols="50" rows="10" /></textarea>
<br />
Long Synopsis:
<textarea name="movielong" type="text" cols="50" rows="10" /></textarea>
<br />
Genre:
<input name="moviegenre" type="text" size="30" maxlength="100" />
<br />
Image Link:
<input name="movieimage" type="text" size="30" maxlength="400" />
<br />
Trailer Link:
<input name="movietrailer" type="text" size="30" maxlength="100" />
<br />
Offical Website:
<input name="moviewebsite" type="text" size="30" maxlength="100" />
<br />
<label>
<input type="submit" value="Add Movie" /><br />
</form>
</div>
</div>
</fieldset>
So what I need is the movieimage tab updated to have an upload feature and once uploaded, send the URL of the image to the database table $movieimage
Here is the database insert information
<?
$username="****";
$password="****";
$database="****";
$host="****";
$movieby=$_POST['movieby'];
$moviename=$_POST['moviename'];
$moviedirector=$_POST['moviedirector'];
$moviestarring=$_POST['moviestarring'];
$movierelease=$_POST['movierelease'];
$movieruntime=$_POST['movieruntime'];
$movieshort=$_POST['movieshort'];
$movielong=$_POST['movielong'];
$moviegenre=$_POST['moviegenre'];
$movieimage=$_POST['movieimage'];
$movietrailer=$_POST['movietrailer'];
$moviewebsite=$_POST['moviewebsite'];
mysql_connect($host,$username,$password);
mysql_select_db($database);
$query = "INSERT INTO moviescomedy VALUES ('NULL','$movieby','$moviename','$moviedirector','$moviestarring','$movierelease','$movieruntime','$movieshort','$movielong','$moviegenre','$movieimage','$movietrailer','$moviewebsite')";
mysql_query($query);
mysql_close();
?>
<fieldset class="fieldset"><legend><span class="Header">Add Movie:</span></legend>
<div class="div">
<div align="center">
Hi <?php print "$movieby"; ?> Your Movie Was Added Successfully!<br />
<br /><?php print "$moviename"; ?><br><img src="<?php print "$movieimage"; ?>">
<table width="102" height="102" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"></td>
</tr>
</table>
<br />
<a href="addmovie.php">Add another Movie?</a> </div>
</div>
</fieldset>
Hope you can help!! I'm desperate !
Thanks,
Andy