Help - Create new page with form input & fix upload issue.

Hello all, First I would like to say thank you to anyone helping, it is very much appreciated.

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 submit 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.

Here is everything I have so far

My database


<head><title>Add Movie or Tv show</title></head>

<form enctype="multipart/form-data" id="myForm" action="addedinfo.php" method="post">
<table width="1233" height="593" border="0">
  <tr bgcolor="#FFFFFF">
    <th height="160" colspan="3" scope="col"><h1><strong>Add Movie or TV Show to Database</strong></h1></th>
    <td width="317" height="425"><p>               Movie Name:</p>
        <input type="text" name="Movie_Name" />
        <br />
        <label> Poster<br>
        <input type="FILE" name="Poster">
        <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>
        <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>
    <td width="900"><p>&nbsp;</p>
        <label class="label">Quality:<br>
        <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>
      <p> Year:</p>
        <input type="text" name="Year" />
        <br />
      <p>Trailer: </p>
        <input type="text" name="Trailer" />
        <br />
        <textarea cols="50" rows="4" name="Synopsis"></textarea>
    <td width="900"><img src="Reel.jpg"  alt="" width="447" height="407" align="top"/></td>
<h1 align="left"><button id="sub">Submit</button>

<span id="result"></span/


db.php (connection to database)

	$conn = mysql_connect("localhost", "root", "spencer");
	$db   = mysql_select_db('movies');

and addedinfo.php It has an error currently. Notice: Array to string conversion in C:\xampp\htdocs\movies\addedinfo.php on line 18
Line 18 = if (mysql_query (“INSERT INTO movieinfo VALUES (’’,’$Movie_Name’,’$Poster’, ‘$genres’, ‘$IMDB_Rating’, ‘$Quality’, ‘$Year’, ‘$Trailer’,’$Synopsis’)”))
I’m not sure if it’s the image (poster) Genres(array) or Synopsis causing the error.


<?php include_once('db.php'); if($_SERVER['REQUEST_METHOD'] == 'POST'){ $Movie_Name = $_POST['Movie_Name']; $Poster = $_FILES['Poster']; if(isset($GenreArray)) { $genres = serialize($GenreArray); } else { $genres = ''; // this is in case user selects nothing (to be on the safe side) } $IMDB_Rating = $_POST['IMDB_Rating']; $Quality = $_POST['Quality']; $Year = $_POST['Year']; $Trailer = $_POST['Trailer']; $Synopsis = $_POST['Synopsis']; } if (mysql_query ("INSERT INTO movieinfo VALUES ('','$Movie_Name','$Poster', '$genres', '$IMDB_Rating', '$Quality', '$Year', '$Trailer','$Synopsis')")) 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 knowledge.

Sponsor our Newsletter | Privacy Policy | Terms of Service