How To Upload A File

Fait

Seasoned Veteran
Joined
Oct 15, 2010
Messages
4,407
Reaction score
561
FP$
2,054
Hey,

im trying to make a video site like YouTube but for webmasters.

Now i have created the form to upload the video to the server but when i click onto a file, It only displays the files name? and not the actual thing that whats in the file.
[code<?php
//start the session for the user
session_start();
//we need to connect to our database first
$connect = mysql_connect ("localhost","root","") or die ("There was a probablem connecting to the server");
$select = mysql_select_db ("pph");
$query = mysql_query ("SELECT * FROM videos");
$username = $_SESSION['username'];
$posttitle = $_POST['vtitle'];
$postgat = $_POST['gatagory'];
$postvid = $_POST['upload'];
$postfile = $_POST['File'];

if ($postgat == false)
die ("You Must Apply A Gatagory All Fields Cannot Also Be Blank!");
else
if ($postvid == 5)
die ("You Apply A Video");

$query = $query = mysql_query("INSERT INTO videos (username, title, video, Gatagory)
VALUES ('$username', '$posttitle', '$postfile', '$postgat')") or die ("There was a probablem processing the query");




echo ("Your Video Has Been Uploaded To The Server Successfully");


?>][/code]
 
This is rather scary 😵

- sorry to be a pain but category not gatagory.

- $query = $query = mysql_query should be $query = mysql_query

- problem not probablem.

Why are you doing a SELECT * FROM videos query up the top? you're not making use of any of this data. Also I would atleast htmlentities() each of the $_POST to stop injection.

And what do you mean by it only shows the file name and not title, do you mean in the box where you browse the file? there's nothing you can do with that it's not server sided it's done by the browser and simply states the file name.
 
Back
Top Bottom