everytime i download via my phone, always error and "your browser not a mobile" even i use my nokia 6600
	
							
						
					Code:
	
	<?php
include("core.php");
include("config.php");
connectdb();
$sid = $_GET["sid"];
$did = $_GET["did"];
$agent = $_SERVER['HTTP_USER_AGENT'];
$uid = getuid_sid($sid);
if (eregi("mozilla", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("anonymouse.org", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("winwap", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("gecko", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("omniweb", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("msie", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("konqueror", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("safari", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("netpositive", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("lynx", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("elinks", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("links", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("w3m", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("webtv", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("amaya", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("ibrowse", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("icab", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("crazy browser", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
if (eregi("internet browser", $agent))
 {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error Browser</title>";
      echo "<p align=\"center\">";
      echo "Your browser is not a mobile phone<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
$uid = getuid_sid($sid);
 if(islogged($sid)==false)
    {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Session error</title>";
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or<br/>Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
$tid = getfile($did);
  if($tid==0)
    {
echo "<head>";
   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error File</title>";
      echo "<p align=\"center\">";
      echo "File has been deleted or not in our database.<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
$res = mysql_fetch_array(mysql_query("SELECT itemurl, title, id, mime FROM ibwf_vault WHERE id='".$did."'"));
if (file_exists("./pkfiles/".$res[0])) {
   $fh = fopen ("./pkfiles/".$res[0],r);
   $thisline= explode('|', fgets($fh));
      $validdownload=$thisline;
   fclose($fh);
}
if($validdownload==0) 
{
echo "<head>";   
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
   echo "</head>";
   echo "<body>";
      echo "<title>Error file</title>";
      echo "<p align=\"center\">";
      echo "File has been deleted or not in our database.<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
mysql_query("UPDATE ibwf_vault SET downloads=downloads+'1' WHERE id='".$did."'");
$res = mysql_fetch_array(mysql_query("SELECT itemurl, title, id, mime, uid FROM ibwf_vault WHERE id='".$did."'"));
$res2 = $res[0];
mysql_query("UPDATE ibwf_users SET plusses=plusses+'5' WHERE id='".$res[4]."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses-'5' WHERE id='".$uid."'");
header("Location: http://wap.net.ph/pkfiles/$res2");
?>


Comment