本文整理汇总了PHP中tools::upload_img方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::upload_img方法的具体用法?PHP tools::upload_img怎么用?PHP tools::upload_img使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::upload_img方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
$titles = '关键词自动回复';
break;
}
if ($_GET['act'] == 'add') {
$stime = $_POST['stime'];
$spic = $_POST['spic'];
$sname = $_POST['sname'];
$surl = $_POST['surl'];
$sdec = $_POST['sdec'];
if ($_FILES['newimg']['name'] != "") {
$path = "../uploads/" . substr($stime, 0, 4) . "/" . substr($stime, 5, 2);
$tools->create_dirs($path);
@unlink($path . "/" . $spic);
$houZhui = $tools->get_files_endname($_FILES['newimg']['name']);
$spic = date("YmdHis") . $tools->get_random(5) . '.' . $houZhui;
$tools->upload_img($_FILES['newimg'], $spic, $path . "/");
}
if ($nid > 0) {
$dbconn->noretquery("update " . DBQIAN . "news_send set spic='{$spic}',sname='{$sname}',surl='{$surl}',sdec='{$sdec}' where id=" . $nid);
} else {
$dbconn->noretquery("insert into " . DBQIAN . "news_send(kid,sname,sdec,spic,surl,stime)values\n\t\t({$kid},'{$sname}','{$sdec}','{$spic}','{$surl}','{$stime}')");
}
$dbconn->showalert("保存成功", "huifu.contentlist.php?stype=" . $stype . "&kid=" . $kid, 1);
}
echo '<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>欢迎登录后台管理系统</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/right.css" rel="stylesheet" type="text/css">
示例2: intval
$hminmoney = intval($_POST['hminmoney']);
$hmaxmoney = intval($_POST['hmaxmoney']);
$hdesc = $_POST['hdesc'];
$hfentitle = $_POST['hfentitle'];
$hfenimg = $_POST['hfenimg'];
$hfendes = $_POST['hfendes'];
$hfaci = $_POST['hfaci'];
$hlingqu = str_replace(",", ",", $_POST['hlingqu']);
$hjinzhiqu = str_replace(",", ",", $_POST['hjinzhiqu']);
if ($_FILES['newimg1']['name'] != "") {
$path = "../uploads/" . substr($times, 0, 4) . "/" . substr($times, 4, 2);
$tools->create_dirs($path);
@unlink($path . "/" . $hfenimg);
$houZhui = $tools->get_files_endname($_FILES['newimg1']['name']);
$hfenimg = date("YmdHis") . $tools->get_random(5) . '.' . $houZhui;
$tools->upload_img($_FILES['newimg1'], $hfenimg, $path . "/");
}
if ($nid > 0) {
$dbconn->noretquery("update " . DBQIAN . "xianjin_set set \n htotalmoney={$htotalmoney},\n hminmoney={$hminmoney},\n hmaxmoney={$hmaxmoney},\t \n hdesc='{$hdesc}',\n\t hfentitle='{$hfentitle}',\n\t hfenimg='{$hfenimg}',\n\t hfendes='{$hfendes}',\n\t hlingqu='{$hlingqu}',\n\t hjinzhiqu='{$hjinzhiqu}',\n\t hfaci='{$hfaci}' where id={$nid}");
} else {
$dbconn->noretquery("insert into " . DBQIAN . "xianjin_set(htotalmoney,hminmoney,hmaxmoney,hdesc,hfentitle,hfenimg,hfendes,hfaci,htime,hlingqu,hjinzhiqu,adminid)values\n\t ({$htotalmoney},{$hminmoney},{$hmaxmoney},'{$hdesc}','{$hfentitle}','{$hfenimg}','{$hfendes}','{$hfaci}',{$htime},'{$hjinzhiqu}','{$hjinzhiqu}',{$adminid})");
}
$dbconn->showalert("保存成功", "hongbao.set.php", 1);
}
echo '<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>欢迎登录后台管理系统</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/right.css" rel="stylesheet" type="text/css">