99
hi mate sorry for the delay,
the form code is
Quote:
echo "<div border="0" cellspacing="0" cellpadding="0" align="center"><big><b>"._MD_UPLOAD_IMAGE."</b></big><br><br>
<form method=' post ' action=' upload_image.php ' enctype='multipart/form-data'>
<input type=" file " id=" file " name=" file " size=" 50 " maxlength=" 60 ">
<input id="xoops_upload_file[]" type="hidden" value="file" name="xoops_upload_file[]"/><br><br>
<input type="hidden" id="lid" name="lid" size="50" maxlength="60" value="$lid">
<input type="submit" class="button" name="submit" id="submit" value=""._MD_ADD.""></input>
</form>
and the code to get what is posted is
Quote:
global $xoopsDB, $_POST, $myts, $eh;
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php';
$lid = $myts->makeTboxData4Save($_POST["lid"]);
$destination_path = XOOPS_ROOT_PATH."/modules/myreviews/images/shots/";
$allowed_mimetypes = array('image/gif', 'image/jpeg','image/png');
$maxfilesize = 4194304;
$maxfilewidth = 800;
$maxfileheight = 800;
$uploader = new XoopsMediaUploader($destination_path, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
$uploader->setPrefix("shot");
$x=0;
if ($uploader->fetchMedia($_POST['xoops_upload_file'][$x]))
{
if (!$uploader->upload())
{
$result = $uploader->getErrors();
echo $result;
} else //update db
{
$logourl = $uploader->getSavedFileName();
$xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("myreviews_images")." (lid, src) VALUES ($lid, $logourl)") or $eh->show("0013");
redirect_header("index.php",1,_MD_DBUPDATED);
}
}
else {
print_r($_POST);
}
}
whats weird is that this used to work, also the $_FILES['tmp_name'] is empty.
Finally the fckeditor image upload tool doesnt work! I asked the hosting company for any errors perhaps or php settings but they respond that this might be a XOOPS problem and that they see nothing weird in the servers configuration!!!