Okay I have a database where it stores the users information, like their login name, email, and password.
They can upload videos to my site, when they upload the videos, it saves to a database, the database is
set up like this,
VIDEONAME EMAIL NAME
funny sample@email.com abcd.mp4
It stores the users email who posted the video, and it saves the location of the video when it was uploaded, which is the field called NAME and it saves the name the user gave it once he uploaded the video. Which is VIDEONAME.
Now the user can view his the videos he uploaded from this webpage,
<?PHP
require_once("./include/membersite_config.php");
if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("login.php");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>An Access Controlled Page</title>
<link rel="STYLESHEET" type="text/css" href="style/fg_membersite.css">
</head>
<body>
<img src="style/RadHalfsLogo.png" id="background" alt="Background Image for Web page" />
<div id="access_controlled">
<div id='fg_membersite_content'>
<p>
Logged in as: <?= $fgmembersite->UserFullName() ?>
<div id="videos_uploaded">
<!-- This is the function that is called which displays all of the users video-->
<?= $fgmembersite->VideosUserUploaded() ?>
</div>
</p>
</div>
</div>
</body>
</html>
Now comes the tricky part. The function which displays the name of the videos which the user uploaded
is this script below,
<?php
session_start();
$email=$_SESSION['email_of_user'];
$con = mysql_connect("hostname.com","username","password");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("radhalfs", $con);
$result = mysql_query("
SELECT videos.videoname,videos.name
FROM videos,
fgusers3
WHERE videos.email='$email' AND fgusers3.email='$email'
");
echo "Uploaded Videos";
while ($row = mysql_fetch_array($result)) {
$link=$row['videoname'];
$file_location=$row['name'];
echo "<div id=\"videos_uploaded_by_user\">";
echo "<a href='uploads/upload/browseplayer.html'>$link</a>";
echo "</div>";
}
mysql_close($con);
?>
Now, this code connects to the database and displays all of the information where the current users email matches the emails in the table which stores the videos name and location, I showed that table above.
In my table example a user saved their video as funny, but its location is abcd.mp4, so I want when the
user clicks on the hyperlink that says funny to have them redirected to this page, and have the name abcd.mp4 be inputed into the src spot.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Untitled Document</title>
<meta charset="utf-8"/>
</head>
<body>
<video controls="controls" src="<!-- This is the src spot-->"> </video>
</body>
</html>
I was thinking if there was a way to do it with cookies, but am not sure how to do so, because every video which is displayed onto the webpage doesnt have its own varaible, it is just saved as $link and the location of the video isnt linked with the video name. So can somone please help.