Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Database connection stuff here
- $link = mysql_connect('localhost', 'root', 'dancehall');
- if (!$link) {
- die('Not connected : ' . mysql_error());
- }
- $db_selected = mysql_select_db('counter', $link);
- if (!$db_selected) {
- die ('Can\'t use foo : ' . mysql_error());
- }
- $x ="SELECT * from counter where id='$id'";
- $result = mysql_query($x) or die
- ("Could not execute query : $x." . mysql_error());
- while ($row = mysql_fetch_array($result))
- {
- $id = $row["id"];
- $FileName = $row["FileName"];
- $FileURL = $row["FileURL"];
- $Count = $row["Count"];
- header('Location: '.$FileURL);
- $x ="update counter set Count=Count+1 where id='$id'";
- $result = mysql_query($x) or die
- ("Could not execute query : $x." . mysql_error());
- }
- ?>
Add Comment
Please, Sign In to add comment