Guest skymuss Posted April 19, 2008 Share Posted April 19, 2008 Hi iam form Germany I want to optimize this script This is a part of a pichoster script. Who can i optimize or improve the performance of this script ?? thx skymuss <?php if(isset($_GET['i'])&&!empty($_GET['i'])) { $i=htmlspecialchars($_GET['i']); $db=mysql_connect('axaaxaaxa','axaaxax','axaxxax'); $db_connect=mysql_select_db('imageant3',$db); $sql="SELECT image_id,image_save,image_size FROM image WHERE image_name='".$i."' LIMIT 1"; $a=mysql_query($sql); $b=mysql_num_rows($a); if($b===1) { $da=mysql_fetch_array($a); $is=$da['image_save']; $isi=$da['image_size']; $id=$da['image_id']; $sql2="SELECT 1 FROM traffic WHERE traffic_imageid='".$id."' LIMIT 1"; $c=mysql_query($sql2); $c=mysql_num_rows($c); if ($c == 1) { $sql3="UPDATE traffic SET traffic_size=traffic_size+'".$isi."' WHERE traffic_imageid='".$id."'"; } else { $sql3="INSERT INTO traffic (traffic_imageid, traffic_size) VALUES (".$id.", ".$isi.")"; } $c=mysql_query($sql3); switch($is) {case 1: $ip = 'http://www.examlpe.org/files/'.$i; break;} $rand = rand(0, 5); if($rand === 1){ $ip = "../img/index.gif"; } header('Location: '.$ip); }}?> Link to comment https://forums.phpfreaks.com/topic/101838-optimize-a-pichoster-script/ Share on other sites More sharing options...
chigley Posted April 19, 2008 Share Posted April 19, 2008 What ever happened to "if it ain't broke, don't fix it"? If it works, I don't see why you should bother changing it. Link to comment https://forums.phpfreaks.com/topic/101838-optimize-a-pichoster-script/#findComment-521162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.