title: Upload/Display video on my web page using PHP:
body: <p>Am trying to save and display video on my page. Videos are saved to my     directory and name,url are saved my db.
  Am going to display my video on watch.php page. But the problem is     videos didn't played. what i made wrong. Help me</p>
  
  <pre><code>**index.php:**
  &lt;?php
  
  $dbhost = 'localhost';
  $dbuser = 'root';
  $dbpass = 'password';
  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  mysql_select_db("websites", $conn);
  
  if(isset($_POST['submit']))
  {
      $name=$_FILES['file']['name'];
      $temp=$_FILES['file']['tmp_name'];
  
      move_uploaded_file($temp,"uploaded/".$name);
      $url="http://127.0.0.1/PHP/video%20upload%20and%20playback/uploaded    /$name";
      mysql_query("insert into video value('$name','$url') ");
  }
  </code></pre>
  
  <p>?></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Video Upload and Playback&lt;/title&gt;
  &lt;link rel="stylesheet" href="style.css"/&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="box"&gt;
  &lt;form action="index.php" method="POST" enctype="multipart/form-data"&gt;
  Select Video: &lt;br/&gt;
  &lt;input type="file" name="file" /&gt;
  &lt;input type="submit" name="submit" value="Upload" /&gt;      
  &lt;/form&gt;
  &lt;?php
  
  if(isset($_POST['submit']))
  {
  echo "&lt;br /&gt;".$name."has been uploaded";
  }  
  
  ?&gt;    
  &lt;/div&gt;
  &lt;div id="box"&gt;
  &lt;h3&gt;List of videos&lt;/h3&gt;
  &lt;?php
  
  $query=mysql_query("select * from video");
  while($row=mysql_fetch_assoc($query)){
  $name=$row['name'];
  $url=$row['url'];
  echo "&lt;a href='watch.php?name=$name'&gt;$url&lt;/a&gt; &lt;br /&gt;";
  }
  ?&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>This is my video display page
      <strong>watch.php:</strong>
      
  
  <pre><code>$dbhost = 'localhost';
  $dbuser = 'root';
  $dbpass = 'password';
  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  mysql_select_db("websites", $conn);
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;Watch videos&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;?php
  if(isset($_GET['name']))
  {
      $name=$_GET['name'];
      $query=mysql_query("select * from video where name='$name'");
      while($row=mysql_fetch_assoc($query))
      {
      $name=$row['name'];
      $url=$row['url'];
      }
      echo "You are watching ".$name."&lt;br /&gt;";
      echo "&lt;embed src='$url' width='560' height='315'&gt;&lt;/embed&gt;";
  }
  else
  {
      echo "Error !";
  }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my css file.
      <strong>style.css:</strong>
      body {
      background: #222;
      color: #fff;
      font-family: Tahoma;
      font-size: 12px;
      }</p>
  
  <pre><code>#box{
  background: #333;
  padding: 10px;
  width: 50%;
  margin: 50px auto;
  }
  
  input{
  background: #444;
  color: #fff;
  border: 0px;
  padding: 10px;
  margin: 5px 0px;
  }
  
  a{
  text-decoration: none;
  color: #fff;
  }
  
  #url{
  background: #444;
  padding: 10px;
  margin: 5px;
  }
  </code></pre>