1.fileupload.php
<html>
<head>
<title>A File Upload Script</title>
</head>
<body>
<div>
<?php
if ( isset( $_FILES['fupload'] ) ) {
print "name: ". $_FILES['fupload']['name'] ."<br />";
print "size: ". $_FILES['fupload']['size'] ." bytes<br />";
print "temp name: ".$_FILES['fupload']['tmp_name'] ."<br />";
print "type: ". $_FILES['fupload']['type'] ."<br />";
print "error: ". $_FILES['fupload']['error'] ."<br />";
if ( $_FILES['fupload']['type'] == "image/gif" ) {
$source = $_FILES['fupload']['tmp_name'];
$target = "upload/".$_FILES['fupload']['name'];
move_uploaded_file( $source, $target );// or die ("Couldn't copy");
$size = getImageSize( $target );
$imgstr = "<p>@@##@@</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/722">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680266384557.png" alt="Kimi智能助手">
</a>
<div class="aritcle_card_info">
<a href="/ai/722">Kimi智能助手</a>
<p>超强AI写作助手,一键总结20w字长文,支持批量文档上传,多端同步内容不怕丢失。论文综述、文档速读、脚本小说创作,统统交给Kimi!实时联网搜索,给你最智能清晰的解答。</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="Kimi智能助手">
<span>3378</span>
</div>
</div>
<a href="/ai/722" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="Kimi智能助手">
</a>
</div>
";
print $imgstr;
}
}
?>
</div>
<form enctype="multipart/form-data"
action="<?php print $_SERVER['PHP_SELF']?>" method="post">
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="102400" />
<input type="file" name="fupload" /><br/>
<input type="submit" value="upload!" />
</p>
</form>
</body>
</html>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号