Jump to content

optimize a pichoster script


Guest skymuss

Recommended Posts

Guest skymuss

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.