在php文件里面插入文件html
2017-10-14 09:09
246 查看
有的时候我们得在php文件里面引入html代码,或者在php文件的某个位置引入文件html,下面就介绍一下实现的方法。
下面是recharge.php的代码:
<?php
require_once "../../config.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>充值</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../common/css/header.css" />
<link rel="stylesheet" href="css/recharge.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet" />
<script src="http://i.gtimg.cn/qzone/biz/gdt/lib/jquery/jquery-2.1.4.js?max_age=31536000"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script src="../common/js/common.js"></script>
<script src="../config.js"></script>
<script src="js/recharge.js"></script>
</head>
<body>
<script type="text/javascript">
var serviceChargePoint = <?php echo $redbag_cash_in_point;?>;
</script>
<!-- 引入公共模块:只有logo的导航条 -->
<?php
include_once('../common/header2.html');
?>
<div class="rechargeDiv">
<h2>充值到账户</h2>
<p>当前账户余额:<span class="balance" id="balance">0.00</span>元</p>
<input type="text" name="data" class="rechargeInput" placeholder="请输入充值数额(元)" id="rechargeInput" onkeyup="calculatePoundage()">
<p class="poundage">手续费<span class="poundageMoney" id="poundageMoney" name="result">0.00</span>元(手续费=充值金额*<?php echo $redbag_cash_in_point;?>%)</p>
<p>需支付:<span class="pay" id="pay">0.00</span>元</p>
<span class="example">例如:您充值22元,则共需支付22+22*<?php echo $redbag_cash_in_point;?>%=24.2元</span>
<button type="button" class="rechargeBtn" id="rechargeBtn">充值</button>
</div>
</body>
</html>我们可以在php文件里面直接写html的标签,用来显示页面的。
也可以在<body></body>标签的任意位置引入文件html,如下面的形式:
<?php
include_once('../common/header2.html');
?>注意:路径一定要正确
下面是recharge.php的代码:
<?php
require_once "../../config.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>充值</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../common/css/header.css" />
<link rel="stylesheet" href="css/recharge.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet" />
<script src="http://i.gtimg.cn/qzone/biz/gdt/lib/jquery/jquery-2.1.4.js?max_age=31536000"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script src="../common/js/common.js"></script>
<script src="../config.js"></script>
<script src="js/recharge.js"></script>
</head>
<body>
<script type="text/javascript">
var serviceChargePoint = <?php echo $redbag_cash_in_point;?>;
</script>
<!-- 引入公共模块:只有logo的导航条 -->
<?php
include_once('../common/header2.html');
?>
<div class="rechargeDiv">
<h2>充值到账户</h2>
<p>当前账户余额:<span class="balance" id="balance">0.00</span>元</p>
<input type="text" name="data" class="rechargeInput" placeholder="请输入充值数额(元)" id="rechargeInput" onkeyup="calculatePoundage()">
<p class="poundage">手续费<span class="poundageMoney" id="poundageMoney" name="result">0.00</span>元(手续费=充值金额*<?php echo $redbag_cash_in_point;?>%)</p>
<p>需支付:<span class="pay" id="pay">0.00</span>元</p>
<span class="example">例如:您充值22元,则共需支付22+22*<?php echo $redbag_cash_in_point;?>%=24.2元</span>
<button type="button" class="rechargeBtn" id="rechargeBtn">充值</button>
</div>
</body>
</html>我们可以在php文件里面直接写html的标签,用来显示页面的。
也可以在<body></body>标签的任意位置引入文件html,如下面的形式:
<?php
include_once('../common/header2.html');
?>注意:路径一定要正确
相关文章推荐
- PHP文件插入header("Content-type: text/html; charset=utf-8"); 报错
- html文件中插入php代码的几种方式
- html文件中插入PHP代码生效
- 在b2core框架和simple_html_dom.php文件里面都有一个load()函数
- 在php文件里面写js和html
- PHP 引入并读取php数据文件,改html后缀为php完成html的一次编写ul,li遍历出现多次li
- PHP压缩一个文件夹里面所有的文件,多文件混合压缩
- html文件执行php语句
- 文件上传的实现 (马马 2001年09月28日 17:14) PHP同样支持上传文件的功能,但并不是所有支持PHP的网站都支持此功能,特别是免费的网站。 实现上传,首先要在HTML上加入上传文件的“<FORM>”表格。 <form me
- php 在文件指定行插入数据的代码
- php 批量生成html、txt文件
- PHP关联的html中if条件的判断,是否在里面(in_array),而不用遍历了
- [轉載]史上最强php生成pdf文件,html转pdf文件方法
- 解决lnmp环境nginx无法解析php文件,html正常解析
- ajax下插入html,里面的元素无法添加事件
- 在sublime里面按快捷键ctrl+b运行php文件,js文件
- php实现将上传word文件转为html的方法
- PHP插入header('content-type:text/html;charset="utf-8')和error_reporting()
- Ajax——使用html配合php实现文件上传到服务器
- php+html下载文件