Jump to content

Search the Community

Showing results for tags 'multipart/form-data'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi all I've been having issues making this code, I'm a huge noob and have been watching youtube videos for the past couple of days and trying to create a website with a database of my movies.(I know there are programs for this but I would like to make my own) This site is only going to be running on localhost. I'm having issues uploading my info(mainly the image for Poster) and if anyone could look at my code/database setup and help me out that would be great First here is a screenshot of what my database looks like. http://i.imgur.com/14DQTCh.jpg Next here is my index.html file <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> As you can see I'm trying to post the following information Movie Name, Poster of the movie, Genre, Rating, Quality, Year, and the Trailer Next I have my connection script db.php <?php $conn = mysql_connect("localhost", "root", "spencer"); $db = mysql_select_db('movies'); ?> Next my addinfo.php <?php include_once('db.php'); $Movie_Name = $_POST['Movie_Name']; $Poster = $_POST['Poster']; $Genre = $_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', '$Genre', '$IMDB_Rating', '$Quality', '$Year', '$Trailer')")) echo "Successfull"; else echo "Failed" ?> and lastly I have a little javascript my_script.js $("#sub").click( function() { $.post( $("#myForm").attr("action"), $("#myForm :input").serializeArray(), function(info){ $("#result").html(info); }); clearInput(); }); $("#myForm").submit( function() { return false; }); function clearInput() { $("#myForm :input").each( function() { $(this).val(''); }); } The error I get is: Notice: Array to string conversion in C:\xampp\htdocs\movies\addedinfo.php on line 12 Successfull When I look at the database I notice a couple of things: 1 the image is 5B so I don't think it uploads right, along with in the Genre only seems to pick up the last selection of the multiple selection My overall goal is to make a website that I can use to have a database of all my movies and tv shows on that I can add too and search through to find something to watch. So right now I'm making code to upload movies to the database, later I will make a site that will show all of the different movies I have and will be searchable through the movie name, genre, rating, quality and or year. I appreciate any help very much!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.