Skip to content

Commit

Permalink
fix for undefined index notice in stats when there's no referer
Browse files Browse the repository at this point in the history
  • Loading branch information
jfro committed Mar 14, 2010
1 parent c22aa47 commit bcd25bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion -/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function record_stats($db, $url_id) {
$stmt = $db->prepare('INSERT INTO '.DB_PREFIX.'url_stats (url_id, ip_address, referer, created_on) VALUES(?,?,?,?)');
$stmt->bindValue(1, $url_id);
$stmt->bindValue(2, $_SERVER['REMOTE_ADDR']);
$stmt->bindValue(3, $_SERVER['HTTP_REFERER']);
$stmt->bindValue(3, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);
$stmt->bindValue(4, date('Y-m-d H:i:s'));
$stmt->execute();
}
Expand Down

0 comments on commit bcd25bb

Please sign in to comment.