2021-07-29 原來php也可以那麼的和藹可親 #html css篇 (拋磚引玉) - 檔案上載

这段PHP代码创建了一个用于上传CSV文件的表单,表单采用了HTML和CSS进行样式设计,提交后将跳转到'tr.php'页面处理。代码中包含了多个外部CSS和JavaScript库的引用,可能用于增强页面的视觉效果和交互性。
摘要由CSDN通过智能技术生成

我們再深入一點

做一個上載檔案的表單

<?php
if(!isset($_SESSION)) {session_start();} 
require_once("設定.php");//載入 設定檔
$轉跳頁='tr.php';
$定義='按鈕info';
$定義類=$CSS類定義 ->轉譯機($定義);
$命名='按鈕';
$值='上載csv';
$檔案處裡->上載檔案($轉跳頁,$定義類,$命名,$值);
?>
function 上載檔案($轉跳頁,$定義類,$命名,$值)
{
echo '
<form method="post" enctype="multipart/form-data" action="'.$轉跳頁 .'">
  <input class="'.$定義類.' " type="file" name="'.$命名.'">
  <input class="'.$定義類.' "  type="submit" value="'.$值.'">
</form>';
}

在这里插入代码片網頁所呈現的
在这里插入图片描述
下圖是轉譯成html 方式

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="John.Hsieh">
<link rel=stylesheet type="text/css" href="my_css.css">
<link href="http://xxxxx/assets/css/john.css" rel="stylesheet">
<link href="http://xxxxx/assets/css/oneui.min.css" rel="stylesheet">

<script type="text/javascript" src="http://xxxxx/assets/js/oneui.core.min.js"></script>
<script type="text/javascript" src="http://xxxxx/assets/js/oneui.app.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<link href="http://xxxxx/css/w3.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap.min.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap-grid.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap-grid.min.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap-reboot.css" rel="stylesheet">
<link href="http://xxxxx/css/bootstrap-reboot.min.css" rel="stylesheet">
<link href="http://xxxxx/css/normalize.css" rel="stylesheet">

<script type="text/javascript" src="http://xxxxx/js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="http://xxxxx/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="http://xxxxx/js/bootstrap.js"></script>
<script type="text/javascript" src="http://xxxxx/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://xxxxx/js/left-side-menu.js"></script>
<script type="text/javascript" src="http://xxxxx/js/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="http://xxxxx/js/jquery.sortable.js"></script>

<form method="post" enctype="multipart/form-data" action="tr.php">
  <input class="btn btn-info " type="file" name="按鈕">
  <input class="btn btn-info "  type="submit" value="上載csv">
</form>

這樣的方式比較容易重複使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值