File size: 607B
<?php
require"../system/config.php";
if(isset($_GET['id_photo'])){$id_photo=(int)$_GET['id_photo'];}else{
$id_photo=0;}
if(!empty($id_photo)){
$ofile=mysql_query("SELECT * FROM `photos` WHERE `id_photo`='$id_photo' AND `type`='file' LIMIT 1");
}
if(mysql_num_rows($ofile)==0){echo'FATAL ERROR';}else{ $sfile=mysql_fetch_array($ofile); if(!empty($id_photo)){mysql_query("update photos set loads=loads+1 where id_photo='$id_photo' and type='file' limit 1");
header('Location: ../photos/'.$sfile['id_photo'].'_'.$sfile['id_user'].'_'.$krsite.'.'.$sfile['format']);
}}
mysql_close();
?>