Hello all, First I would like to say thank you to anyone helping, it is very much apperciated.
I'm trying to create a database of all of my movies(I know there are programs that do this but I would like to make my own)
So far I have created a database with xammp and a form to insert information into that database (I think it's working right)
I would like for the sumbit button of my form to create a new page that lists all of the form information, I would like to have a template for this page and place holders for where all the information will go, however I don't know how I should go about doing this, I've been searching for atleast 5 hours trying to find tutorials but with no luck.
Here is everything I have so far
My database http://i.imgur.com/14DQTCh.jpg
index.html
<html>
<head><title>Add Movie or Tv show</title></head>
<body>
<form enctype="multipart/form-data" id="myForm" action="addedinfo.php" method="post">
<h1 align="center"><strong>Add Movie or TV Show to Database</strong></h1>
<p> </p>
<p>Movie Name:
<input type="text" name="Movie_Name" /><br />
</p>
<p><label> Poster</label>
<input type="FILE" name="Poster"> <br>
</p>
<p>Genre:
<select multiple name="Genre[]" id="Genre">
<option value="All" style="text-indent: 0px;" selected="selected">All</option>
<option value="Action" style="text-indent: 0px;">Action</option>
<option value="Adventure" style="text-indent: 0px;">Adventure</option>
<option value="Animation" style="text-indent: 0px;">Animation</option>
<option value="Biography" style="text-indent: 0px;">Biography</option>
<option value="Comedy" style="text-indent: 0px;">Comedy</option>
<option value="Crime" style="text-indent: 0px;">Crime</option>
<option value="Documentary" style="text-indent: 0px;">Documentary</option>
<option value="Drama" style="text-indent: 0px;">Drama</option>
<option value="Family" style="text-indent: 0px;">Family</option>
<option value="Fantasy" style="text-indent: 0px;">Fantasy</option>
<option value="Film-Noir" style="text-indent: 0px;">Film-Noir</option>
<option value="History" style="text-indent: 0px;">History</option>
<option value="Horror" style="text-indent: 0px;">Horror</option>
<option value="Mystery" style="text-indent: 0px;">Mystery</option>
<option value="Romance" style="text-indent: 0px;">Romance</option>
<option value="Sci-Fi" style="text-indent: 0px;">Sci-Fi</option>
<option value="Short" style="text-indent: 0px;">Short</option>
<option value="Sport" style="text-indent: 0px;">Sport</option>
<option value="Thriller" style="text-indent: 0px;">Thriller</option>
<option value="War" style="text-indent: 0px;">War</option>
<option value="Western" style="text-indent: 0px;">Western</option>
</select>
</p>
<p>
<label>IMDB Rating:</label>
<select name="IMDB_Rating" id="IMDB_Rating">
<option value="0" style="text-indent: 0px;" selected="selected">All</option>
<option value="9.9" style="text-indent: 0px;">10</option>
<option value="9" style="text-indent: 0px;">9+</option>
<option value="8" style="text-indent: 0px;">8+</option>
<option value="7" style="text-indent: 0px;">7+</option>
<option value="6" style="text-indent: 0px;">6+</option>
<option value="5" style="text-indent: 0px;">5+</option>
<option value="4" style="text-indent: 0px;">4+</option>
<option value="3" style="text-indent: 0px;">3+</option>
<option value="2" style="text-indent: 0px;">2+</option>
<option value="1" style="text-indent: 0px;">1+</option>
</select>
</p>
<p>Quality:
<label class="label">Quality:</label>
<select name="Quality" id="Quality">
<option value="All" style="text-indent: 0px;" selected="selected">All</option>
<option value="1080p" style="text-indent: 0px;">1080p</option>
<option value="3D" style="text-indent: 0px;">3D</option>
<option value="480p" style="text-indent: 0px;">480p</option>
<option value="720p" style="text-indent: 0px;">720p</option>
<option value="DVD" style="text-indent: 0px;">DVD</option>
<option value="HDRip" style="text-indent: 0px;">HDRip</option>
</select>
</p>
<p>
Year:
<input type="text" name="Year" /><br />
</p>
<p>Trailer:
<input type="text" name="Trailer" /><br />
</p>
<button id="sub">Submit</button>
</form>
<span id="result"></span/
</body>
</html>
db.php (connection to database)
<?php
$conn = mysql_connect("localhost", "root", "spencer");
$db = mysql_select_db('movies');
?>
and addedinfo.php (It appears the info is going into the database but I do get these errors:
Notice: Array to string conversion in C:\xampp\htdocs\movies\addedinfo.php on line 15
Notice: Array to string conversion in C:\xampp\htdocs\movies\addedinfo.php on line 15
<?php
include_once('db.php');
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$Movie_Name = $_POST['Movie_Name'];
$Poster = $_FILES['Poster'];
if (isset ($_POST['Genre'])){
$GenreArray = $_POST['Genre'];
}
$IMDB_Rating = $_POST['IMDB_Rating'];
$Quality = $_POST['Quality'];
$Year = $_POST['Year'];
$Trailer = $_POST['Trailer'];
}
if (mysql_query ("INSERT INTO movieinfo VALUES ('','$Movie_Name','$Poster', '$GenreArray', '$IMDB_Rating', '$Quality', '$Year', '$Trailer')"))
echo "Successfull";
else
echo "Failed"
?>
I'm not worried about any security as this site will only be running on localhost, as it's just for me.
Thank you again for your time, and knodlege.