A
Anonymous
Guest
I have a table call " photos". The images_upload.php page is for upload images by using browse button in the form and now is running a problem that indicats:
Fatal error: Call to undefined function: select() in /home/symphon1/public_html/admin/images_upload.php on line 26
Or Fatal error: Call to undefined function: author() in /home/symphon1/public_html/admin/images_upload.php on line 25
Can someone to tell me what is problem of that? Here are codes below, Thanks.
<?php require_once('../Connections/apress.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
auth();
$photo=select("$db.photos","id='$photoID'", "" );
if(!empty($upload))
{
//uploads thumbnail
if($_FILES['name']['name']!="")
{
$dir=$admin[dir];
$_FILES['name']['name']-str_replace(" ","",$_FILES['name']['name']);
//check is image is uploaded and move it to the images folder
if(!move_uploaded_file($_FILES['name']['tmp_name'], "images".$_FILES['name']['name']))
$message="Couldn't upload image";
chmod("images".$_FILES['name']['name'],0777);
//choose the image height
$scale="-geometry '115x115>' ";
//image save path
$newThum="images".$_FILES['name']['name']." images".$_FILES['name']['name'];
//imagemagick command format
$command = "/usr/local/bin/convert $scale $newThum";
//execute command
`$command`;
//choose the image height
$scale="-geometry '325x325>' ";
//image save path
$newThum="images".$_FILES['name']['name']." images".$_FILES['name']['name'];
//imagemagick command format
$command = "/usr/local/bin/convert $scale $newThum";
//execute command
`$command`;
}
$_POST[name]=$_FILES['name']['name'];
$remove=array('upload');
insert("$db.images");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>uploadimage</title>
<link href="../main.css" rel="stylesheet" media="screen">
</head>
<body leftmargin="20" marginheight="10" marginwidth="20" topmargin="10">
<form action="<?php print $PHP_SELF;?>" method="post" name="form" enctype="multipart/form-data">
<br>
Upload Image to <?php print "$photo[images]"; ?>'s gallery:<hr size=1><br>
<input type="file" name="name" value="" size="19"><br>
<br>
<input type="submit" name="upload" value="Upload Image">
<input type="hidden" name="photoID" value="<?php print $photoID;?>" >
</form>
</body>
</html>
Fatal error: Call to undefined function: select() in /home/symphon1/public_html/admin/images_upload.php on line 26
Or Fatal error: Call to undefined function: author() in /home/symphon1/public_html/admin/images_upload.php on line 25
Can someone to tell me what is problem of that? Here are codes below, Thanks.
<?php require_once('../Connections/apress.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
auth();
$photo=select("$db.photos","id='$photoID'", "" );
if(!empty($upload))
{
//uploads thumbnail
if($_FILES['name']['name']!="")
{
$dir=$admin[dir];
$_FILES['name']['name']-str_replace(" ","",$_FILES['name']['name']);
//check is image is uploaded and move it to the images folder
if(!move_uploaded_file($_FILES['name']['tmp_name'], "images".$_FILES['name']['name']))
$message="Couldn't upload image";
chmod("images".$_FILES['name']['name'],0777);
//choose the image height
$scale="-geometry '115x115>' ";
//image save path
$newThum="images".$_FILES['name']['name']." images".$_FILES['name']['name'];
//imagemagick command format
$command = "/usr/local/bin/convert $scale $newThum";
//execute command
`$command`;
//choose the image height
$scale="-geometry '325x325>' ";
//image save path
$newThum="images".$_FILES['name']['name']." images".$_FILES['name']['name'];
//imagemagick command format
$command = "/usr/local/bin/convert $scale $newThum";
//execute command
`$command`;
}
$_POST[name]=$_FILES['name']['name'];
$remove=array('upload');
insert("$db.images");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>uploadimage</title>
<link href="../main.css" rel="stylesheet" media="screen">
</head>
<body leftmargin="20" marginheight="10" marginwidth="20" topmargin="10">
<form action="<?php print $PHP_SELF;?>" method="post" name="form" enctype="multipart/form-data">
<br>
Upload Image to <?php print "$photo[images]"; ?>'s gallery:<hr size=1><br>
<input type="file" name="name" value="" size="19"><br>
<br>
<input type="submit" name="upload" value="Upload Image">
<input type="hidden" name="photoID" value="<?php print $photoID;?>" >
</form>
</body>
</html>