Jump to content

how can i replace name of the file with php echo


Lisa23

Recommended Posts

hi i have the above function but what i am trying to do is replace the above the name of the file with the one that will be queried from the database but i keep getting sintax error.

want to to put where it says filr name example (file1.mp4) with the ( <?php echo $filename?>) but i keep getting sintax error

 

PHP Code:

 

 

echo "<td><a href='#' onClick=\"jwplayer().load({'file': 'file1.mp4', 'hd.file': 'file2.mp4'})\"> </td>"; 

 

this how my all code looks like is a simple query four fields frm the database and the issue is make the names into file row into onclick link but i get the sintax error which i think i need to close and ope teh php tags somewhere in order to put the  ( <?php echo $filename?>) because i have it inside teh while loop

help please?

 

this how it whole looks

 

<html>
<head>

</head>


<body>




<?php
$q=$_GET["q"];

$con = mysql_connect('localhost', 'root', '');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("droptest", $con);

$FirstName=$_GET['FirstName'];

$sql="SELECT * FROM user WHERE id = '".$q."'";

$result = mysql_query($sql);

echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>Hometown</th>
<th>Job</th>
<th>secondvideo</th>

</tr>";

while($row = mysql_fetch_array($result))

  {
  echo "<tr>";

   echo "<td>" . $row['LastName'] . ''. $row['Job'] . "</td>";
  echo "<td>" . $row['Age'] . "</td>";
  echo "<td>" . $row['Hometown'] . ''. $row['Job'] . "</td>";
  echo "<td>" . $row['Job'] . "</td>";  

echo "<td><a href='#' onClick="jwplayer().load({'file': '<?php echo $FirstName?>', 'hd.file': 'videos/film.mp4'})"> </td>";

  echo "<td>" . $row['arr'] . "</td>";  
    echo "<td>" . $arr . "</td>";


  echo "</tr>";
  }
echo "</table>";

mysql_close($con);

?>

</body>
</html>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.