好得很程序员自学网
  • 首页
  • 后端语言
    • C#
    • PHP
    • Python
    • java
    • Golang
    • ASP.NET
  • 前端开发
    • Angular
    • react框架
    • LayUi开发
    • javascript
    • HTML与HTML5
    • CSS与CSS3
    • jQuery
    • Bootstrap
    • NodeJS
    • Vue与小程序技术
    • Photoshop
  • 数据库技术
    • MSSQL
    • MYSQL
    • Redis
    • MongoDB
    • Oracle
    • PostgreSQL
    • Sqlite
    • 数据库基础
    • 数据库排错
  • CMS系统
    • HDHCMS
    • WordPress
    • Dedecms
    • PhpCms
    • 帝国CMS
    • ThinkPHP
    • Discuz
    • ZBlog
    • ECSHOP
  • 高手进阶
    • Android技术
    • 正则表达式
    • 数据结构与算法
  • 系统运维
    • Windows
    • apache
    • 服务器排错
    • 网站安全
    • nginx
    • linux系统
    • MacOS
  • 学习教程
    • 前端脚本教程
    • HTML与CSS 教程
    • 脚本语言教程
    • 数据库教程
    • 应用系统教程
  • 新技术
  • 编程导航
    • 区块链
    • IT资讯
    • 设计灵感
    • 建站资源
    • 开发团队
    • 程序社区
    • 图标图库
    • 图形动效
    • IDE环境
    • 在线工具
    • 调试测试
    • Node开发
    • 游戏框架
    • CSS库
    • Jquery插件
    • Js插件
    • Web框架
    • 移动端框架
    • 模块管理
    • 开发社区
    • 在线课堂
    • 框架类库
    • 项目托管
    • 云服务

当前位置:首页>后端语言>PHP
<tfoot draggable='sEl'></tfoot>

phphtml交互 php交互式命令行

很多站长朋友们都不太清楚phphtml交互,今天小编就来给大家整理phphtml交互,希望对各位有所帮助,具体内容如下:

本文目录一览: 1、 一个php 文件与多个html文件如何进行交互 2、 php与html交互。 3、 html与php交互的问题 4、 如何用php与html实现交互,html应该如何写?是正常写,还是要特殊处理? 5、 PHP语言与HTML语言的关系? 一个php 文件与多个html文件如何进行交互

<?php

header("Content-type: text/html; charset=gb2312");

header("Pragma: no-cache");

header("Expires: 0");

@$action = $_REQUEST ['action'];

$sid = MyTool::generateId ();

if (! $action)

$action = "list";

Trace::debug ( $action );

if ($action == "save") {

$reply = $_REQUEST ['reply'];//获取回复值

print_r($reply);

$id = $_REQUEST ['f_id'];

CourseService::updateApplyState($db,$id,TrainApply::STATUS_PASS);

$apply=CourseService::getTrainApply($db,$id);

$student=$apply->owner;

$trainId=$apply->train;

$train=CourseService::getTrainSchedule($db,$trainId);

$pass_test=$train->test==""?0:-1;

$pass_judge=$train->judge==""?0:-1;

$pass_readrate=$train->readrate==""?0:-1;

$pass_feedback=$train->feedback==""?0:-1;

$mc = new MyCourse();

$mc->schedule_id = $train->id;

$mc->course_id = $train->course_id;

$mc->user_id = $student;

$mc->type = $train->catalog;

$mc->state = MyCourse::STATE_WAITING;

$mc->pass_test = $pass_test;

$mc->pass_judge =$pass_judge ;

$mc->pass_feedback = $pass_feedback;

$mc->pass_readrate = $pass_readrate;

$mc->score = $train->score;

$mc->starttime = $train->starttime;

$mc->endtime = $train->endtime;

$mc->coursename = $train->name;

CourseService::save($db, $mc);

print"<script>alert('通过操作成功!');window.close();location.href='applyreply.php?action=list'</script>";

}

if ($action == "reject") {

$id = $_REQUEST ['f_id'];

$sql = "update t_train_apply set f_status=2 where f_id='".$id."'";

Trace::debug ( $sql );

$db->Execute ( $sql );

print"<script>alert('拒绝操作成功!');window.close();location.href='applyreply.php?action=list'</script>";

}

if ($action == "list") {

$pagination = new MyPagination(0,1);

$UserID = $_SESSION[AuthorizationHelper::SESSION_USER_KEY]['id'];

$as = CourseService::listApply($db,$pagination,null,null,null,$UserID);

//print_r($as);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

<?= HTMLTool::includeResource() ?>

<link href="css/css.css" rel="stylesheet" type="text/css" />

<script language="JavaScript">

$(function() {

$('#tabs').tabs({spinner:'加载...',fx:{ opacity: 'toggle' },selected:2});

});

function passIt(id){

var url = '<?php print $_SERVER['PHP_SELF'] ?>';

var pars = 'action=passf_id='+id;

alert(url+"?"+pars);

// open(url+"?"+pars);

var myAjax = new Ajax.Request(

url,

{

method: 'get',

parameters: pars,

onComplete:done

});

afterPass(id);

}

function afterPass(id){

// alert(originalRequest.responseXML);

// var result = originalRequest.responseXML.getElementsByTagName("id");

// alert(result.length);

document.getElementById('button_'+id).style.display='none';

document.getElementById('status_'+id).innerHTML='通过';

}

function rejectIt(id){

var url = '<?php print $_SERVER['PHP_SELF'] ?>';

var pars = 'action=rejectf_id='+id;

//alert(url+"?"+pars);

var myAjax = new Ajax.Request(

url,

{

method: 'get',

parameters: pars,

onComplete:done

});

afterReject(id);

}

function afterReject(id){

// alert(originalRequest.responseXML);

// var result = originalRequest.responseXML.getElementsByTagName("id");

// alert(result.length);

document.getElementById('button_'+id).style.display="none";

document.getElementById('status_'+id).innerHTML="驳回";

}

function done(){

alert("操作成功");

}

</script>

</head>

<body >

<!-- 导航栏 -->

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="navigationbar"  class="navigationbar">

<tr><td height="28" >您现在的位置: <a href="welcom.php">首页</a> >> <a href="#">考试管理</a> >>考试申请管理</td></tr>

</table>

<table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">

<tr>

<td valign="top">

<table width="100%" border="0" cellpadding="1" cellspacing="1" class="listtable">

<thead>

<tr>

<td width="150">考试名称</td>

<td>申请原因</td>

<td width="150">申请人</td>

<td width="130">申请时间</td>

<td width="80">状态</td>

<td width="80">管理</td>

</tr>

</thead>

<?php

//foreach($as as $a){

//Trace::debug($a);

//$schedule = CourseService::getTrainSchedule($db,$a->train);

//$u = UserService::getUser($db,$a->owner);

?>

<tr>

<td><?= $schedule->name ?></td>

<td><?= $a->name ?></td>

<td><?= $u->trueName ?></td>

<td><?= MyTool::formatDate($a->createtime)?></td>

<td><span id="status_<?= $a->id ?>"><?= TrainApply::$STATUS_ARRAY[$a->status]?></span></td>

<td>nbsp;<span id="button_<?= $a->id ?>">

<?php if($a->status==TrainApply::STATUS_WAITING) {?>

<a href="?action=passf_id=<?= $a->id ?>">通过</a>nbsp;

<a href="application_manage.php?action=rejectf_id=<?= $a->id ?>">拒绝</a>

<?php } ?>

</td>

</tr>

<?php //} ?>

</table>

<?php include($_SERVER['DOCUMENT_ROOT']."/train/common/pagination.php")?>

</td>

</tr>

</table>

</body>

</html>

<?php }?>

<?php if($action=="pass") {//回复

?>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

<?= HTMLTool::includeResource() ?>

<script >

$(document).ready(function(){

$("#commonForm").validate();

});

</script>

</head>

<body>

<table width="98%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td  class="border_left_up"></td>

<td  class="border_middle_up"><span class="pagetitle">建议回复</span></td>

<td  class="border_right_up"></td>

</tr>

</table>

</td>

</tr>

<tr>

<td align="center">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="border_left_middle">nbsp;</td>

<td align="center">

<form id="commonForm" method="post">

<input type="hidden" name="action" value="save"/>

<input type="hidden" name="id" value="<?php print $_REQUEST ['id']?>" />

<textarea class="required" rows="10" cols="120" name="reply" maxlength="500">您的建议已采纳,谢谢参与</textarea><br>

<span class="btn_green"><span><button type="submit" id="sure">提 交</button></span></span>

</form>

</td>

<td  class="border_right_middle">nbsp;</td>

</tr>

</table>

</td>

</tr>

<tr>

<td><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td  class="border_left_down"></td>

<td  class="border_middle_down">nbsp;</td>

<td  class="border_right_down"></td>

</tr>

</table></td>

</tr>

</table>

</body>

</html>

<?php } ?>

就是你要的效果,,看仔细点      只看标签与判断就行

php与html交互。

你html页面用ajax异步请求php页面,

然后php页面对提交的数据验证,将验证信息封装成一个json数据返回给html就行,

总之,就是你去了解一下ajax就很简单

html与php交互的问题

浏览器发请求到服务器 服务器解析请求并提取数据 服务器将数据转换为html 服务器把最后解析完成的html返给浏览器

如何用php与html实现交互,html应该如何写?是正常写,还是要特殊处理?

html里面包含php 就是<div><?php echo “php”; ?></div>

php 里面输出html 就 <?php echo “<a>html</a>”; ?>

你说的连接起来,交互是什么意思?

如果要点击一个连接 就跳到 php的话, 就是 <a href="1.php">php</a> 或者用form post

如果要点击一个连接 然后从php得到信息的话,那么就用ajax。那么ajax的东西 去百度一下即可。

PHP语言与HTML语言的关系?

PHP是在html输出之前控制html结构如何去输出数据的,和实现前后端数据交互的,js控制行为,css控制样式,html控制结构,php控制数据,新人只要明白这个架构就足够了

关于phphtml交互的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。

查看更多关于phphtml交互 php交互式命令行的详细内容...

声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did209732
更新时间:2023-05-03   阅读:16次

上一篇: php工程地图 php地图找房

下一篇:php图像自动裁边 php剪切图片

相关资讯

最新资料更新

  • 1.登录注册的php代码 php用户注册登录代码
  • 2.php登陆检测 php登录原理
  • 3.imagephp缩放 缩放图像可以改变图像的分辨率吗
  • 4.php数据库对象 php针对数据库的查询函数是
  • 5.php下载文件完整官方版 php在哪下载
  • 6.php图片打不开 php打不开文件
  • 7.php例子下载 php资料下载
  • 8.php判断是否为蜘蛛 php怎么判断是不是数字
  • 9.php比较数组差集 php比较多个数组中是否有重复值
  • 10.php大牛交流教程 php大神
  • 11.php接口和抽象类的区别 php抽象函数
  • 12.网页php查看源代码 php怎么看源码
  • 13.php手机qr php手机编程软件
  • 14.php的如何使用数组if php中数组
  • 15.php中序递归 php递归算法1加到100
  • 16.web安全php Web安全原理分析与实践
  • 17.php微信推送提醒 php主动推送消息到安卓
  • 18.php代码修改按钮大小 php内容修改
  • 19.erpphp源码下载 thinkphp erp源码
  • 20.php合并特殊字符 php合并单元格的代码

CopyRight:2016-2025好得很程序员自学网 备案ICP:湘ICP备09009000号-16 http://haodehen.cn
本站资讯不构成任何建议,仅限于个人分享,参考须谨慎!
本网站对有关资料所引致的错误、不确或遗漏,概不负任何法律责任。
本网站刊载的所有内容(包括但不仅限文字、图片、LOGO、音频、视频、软件、程序等)版权归原作者所有。任何单位或个人认为本网站中的内容可能涉嫌侵犯其知识产权或存在不实内容时,请及时通知本站,予以删除。

网站内容来源于网络分享,如有侵权发邮箱到:kenbest@126.com,收到邮件我们会即时下线处理。
网站框架支持:HDHCMS   51LA统计 百度统计
Copyright © 2018-2025 「好得很程序员自学网」
[ SiteMap ]