本文整理汇总了PHP中MyDB::insertHistory方法的典型用法代码示例。如果您正苦于以下问题:PHP MyDB::insertHistory方法的具体用法?PHP MyDB::insertHistory怎么用?PHP MyDB::insertHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyDB
的用法示例。
在下文中一共展示了MyDB::insertHistory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: basename
<?php
include_once "_classes/user.php";
session_start();
$uid = $_SESSION['uid'];
$message = $_POST['message'];
$target_dir = "_resources/uploads/{$uid}/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
if (isset($_POST["submit"])) {
$uploadOk = 1;
}
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file " . basename($_FILES["fileToUpload"]["name"]) . " has been uploaded.";
$db = new MyDB();
$db->insertHistory($uid, basename($_FILES["fileToUpload"]["name"]), $message);
$db->close();
} else {
echo "Sorry, there was an error uploading your file.";
}
}