logo

额外区块类型 (EBT) - 全新的布局构建器体验❗

额外区块类型 (EBT) - 样式化、可定制的区块类型:幻灯片、标签页、卡片、手风琴等更多类型。内置背景、DOM Box、JavaScript 插件的设置。立即体验布局构建的未来。

演示 EBT 模块 下载 EBT 模块

❗额外段落类型 (EPT) - 全新的 Paragraphs 体验

额外段落类型 (EPT) - 类似的基于 Paragraph 的模块集合。

演示 EPT 模块 滚动

GLightbox is a pure javascript lightbox (Colorbox alternative without jQuery)❗

It can display images, iframes, inline content and videos with optional autoplay for YouTube, Vimeo and even self-hosted videos.

Demo GLightbox Download GLightbox

滚动
22/02/2025, by 匿名 (未验证)
论坛

请问我应该把文件 upload.php 放在哪里,以便上传表单能够访问这个文件?请给我一些建议,因为我的毕业论文在等着呢。(网站地址 localhost/drupal)

表单代码 (upload.html)
<html>
<head>
<title>文件上传到服务器</title>
</head>
<body>
<h2><p><b> 文件上传表单 </b></p></h2>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="filename"><br>
<input type="submit" value="上传"><br>
</form>
</body>
</html>

表单处理脚本代码 (upload.php)
<html>
<head>
<title>文件上传结果</title>
</head>
<body>
<?php
if($_FILES["filename"]["size"] > 1024*3*1024)
{
echo ("文件大小超过三兆");
exit;
}
// 检查文件是否已上传
if(is_uploaded_file($_FILES["filename"]["tmp_name"]))
{
// 如果文件成功上传,移动它
// 从临时目录到目标目录
move_uploaded_file($_FILES["filename"]["tmp_name"], "/path/to/file/".$_FILES["filename"]["name"]);
} else {
echo("文件上传错误");
}
?>
</body>
</html>