It has links to play other videos. For example.
Code: Select all
<a href="/play.php?id=2">Play Video 2!</a>
<a href="/play.php?id=6">Play Video 6!</a>
<a href="/play.php?id=9">Play Video 9!</a>Moderator: General Moderators
Code: Select all
<a href="/play.php?id=2">Play Video 2!</a>
<a href="/play.php?id=6">Play Video 6!</a>
<a href="/play.php?id=9">Play Video 9!</a>Code: Select all
<?php
$query = "select `Id`, `Name` from `vidoes`"; //just blind query for demo purpose
if (is_resource($result = mysql_query($query)) === TRUE){
while($row = mysql_fetch_row($result)){
?>
<a href = 'http://www.example.com/play.php?id=<?php echo $row[0]; ?>'>
<?php echo $row[1]; ?>
</a>
<?php
}
}
?>Code: Select all
for absolute URL
<a href = '<?php echo $row['Location']; ?>'>
<?php echo $row['name']; ?>
</a>
for relative path..
I assume the movies directory is of the same level of the script running directory
<a href = '../<?php echo $row['Location']; ?>'>
<?php echo $row['name']; ?>
</a>Code: Select all
<?php
$clause = '';
if (!empty($_GET['id'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['id'])
? '`id` ';
: '`fileName` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['id']) .'\' LIMIT 1';
}
$sql = 'SELECT `fileName` FROM `videos` '. $clause;
//now mysql_query($sql) ...
//mysql_fetch_assoc() ...
echo '<EMBED SRC=\'path\to\'.$row['fileName'].'\' AUTOSTART=true></EMBED>';
?>Line 3Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/muot/public_html/newsite/videos/play.php on line 3
Code: Select all
$clause = '';Code: Select all
<?
include("/home/muot/public_html/newsite/videos/connectv.php");
$clause = '';
if (!empty($_GET['id'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['id'])
? '`id` ';
: '`fileName` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['id']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename` FROM `videos` '. $clause;
echo '<EMBED SRC=\'path\to\'.$row['Filename'].'' AUTOSTART=true></EMBED>';
?>Code: Select all
<?php
$clause = '';
if (!empty($_GET['id'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['id'])
? '`id` '
: '`fileName` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['id']) .'\' LIMIT 1';
}
$sql = 'SELECT `fileName` FROM `videos` '. $clause;
//now mysql_query($sql) ...
//mysql_fetch_assoc() ...
echo '<EMBED SRC="path/to/'.$row['fileName'].'" AUTOSTART=true></EMBED>'; ?>Code: Select all
<?php
$username= "muot_video";
$password= "password";
$database= "muot_videos";
mysql_connect(localhost,$username,$password);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`ID` '
: '`Fileame` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql = 'SELECT `Filename` FROM `videos` '. $clause;
//now mysql_query($sql) ...
//mysql_fetch_assoc() ...
echo '<EMBED SRC="path/to/'.$row['Filename'].'" AUTOSTART=true></EMBED>'; ?>Line 6Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/muot/public_html/newsite/videos/play.php on line 6
Is it because there is multiple clause strings?$clause = '';