Ok, i'm such a newbie it's sick hahaha
I'm trying to put together a page where streaming audio file name is hidden. The URL is in a MYSQL database. Plus, i'm trying to count and display how many listens the audio file has on the same page. I found a few scripts on this board that could help me do this, but i'm having trouble piecing them together.
Plus i'm getting: Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site20/fst/var/www/html/audio/audio.php on line 23
What am I doing wrong or what can I do better or i think i'm missing something??? Take pity on me 🙁
the mysql database looks like....
dl_id | dl_url | dl_listens
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
session_start();
?>
<?php
/* Doing the relevant stuff */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
mysql_select_db("database") or die("Could not select database");
$query = "SELECT * FROM downloads WHERE dl_id = '$dl_id";
$result = mysql_query($query) or die("Query failed");
$foo=mysql_fetch_array($result);
$product=$foo['download_url']
mysql_close($link);
?>
<?
header("Location: " . $product);
?>
<?
//adds download to database
$conn = mysql_connect("localhost", "username", "password");
mysql_select_db("database");
$query = "SELECT dl_listens FROM downloads";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_object($result);
$dl_listens = $row->dl_listens;
$dl_listens = $dl_listens + "1";
$query = "UPDATE downloads SET dl_listens = '$dl_listens' WHERE dl_id = '1'";
mysql_query($query);
mysql_close($conn);
?>
<table width="450" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><a href="audio.php?dl_id=1" target="_self">EGO</a></td>
<td><?
$conn = mysql_connect("localhost", "username", "password");
mysql_select_db("database");
$query = "select * from downloads";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_object($result);
$dl_listens = $row->dl_listens;
echo "Downloads of something: ".$dl_listens;
mysql_close($conn);
?>
</td>
</tr>
</table>
</body>
</html>