$dbhost = "supremebloglotcs.db.4273270.hostedresource.com";
$dbusername = "supremebloglotcs";
$dbpassword = "Poilkj123456";
$dbname="supremebloglotcs";
$tableprifix="";
$db = mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($dbname,$db);
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
/* function imgresize($imgfile,$newfilename2,$savelocation,$max_width,$max_height)
{
//$savelocation = "../thumbimg/";
$format=ereg_replace(".*\.(.*)$","\\1",$imgfile);
$format=strtoupper($format);
if (!$max_width)
$max_width = 120;
if (!$max_height)
$max_height = 160;
$size = GetImageSize($imgfile);
$width = $size[0];
$height = $size[1];
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if (($width <= $max_width) && ($height <= $max_height))
{
$tn_width = $width;
$tn_height = $height;
}
else if (($x_ratio * $height) < $max_height)
{
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
else
{
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
//$thumb = ImageCreateTrueColor($tn_width,$tn_height);
$thumb = imagecreatetruecolor($tn_width,$tn_height);
//$thumb = imagecreate($tn_width,$tn_height);
if ($format=="JPG" || $format=="JPEG")
{
//JPEG
$format="JPEG";
$source=ImageCreateFromJPEG ($imgfile);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $tn_width ,$tn_height, $width, $height);
imagejpeg($thumb,"$savelocation".$newfilename2);
}
if($format=="GIF")
{
//GIF
$format="GIF";
$source = ImageCreateFromGIF ($imgfile);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $tn_width ,$tn_height, $width, $height);
imageGIF($thumb,"$savelocation".$newfilename2);
}
if($format=="PNG")
{
//GIF
$format="PNG";
$source = ImageCreateFromPNG($imgfile);
ImageCopyResized($dst, $src, 0, 0, 0, 0, $tn_width,$tn_height,$width,$height);
imagePNG($dst,"$savelocation".$newfilename2);
}
}*/
?>