- Messages
- 5,508
- Reaction score
- 35
- Points
- 48
Is this secure enough?
PHP:
<?php
require_once('includes/config.php');
require_once('includes/functions/func.global.php');
require_once('includes/classes/class.template_engine.php');
require_once('includes/lang/lang_'.$config['lang'].'.php');
db_connect($config);
if($_GET['id']) {
$id = mysql_real_escape_string($_GET['id']);
$query = "SELECT story_url FROM dug_stories WHERE `story_id` = '$id'";
$query_result = mysql_query ($query) OR die(mysql_error());
$info = mysql_num_rows($query_result);
if ($info >0){
$info = mysql_fetch_row($query_result);
mysql_query("UPDATE dug_stories SET story_hits = story_hits+1 WHERE `story_id` = '$id'");
header("Location: ". $info['0']);
} elseif ($info == 0) {
header("Location: /index.php");
}
} else {
header("Location: index.php");
}
?>