POST 服务测试PHP页面

<?php
/*
* Created on 2012-7-12
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include_once 'global.php';

if(!defined('ROOTURL'))
define('ROOTURL',"http://" . $_SERVER['HTTP_HOST'] . "/WebPlayer");//常量 如:http://localhost/MyProject

$smarty->assign("root_url",ROOTURL);


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加Player</title>
<link href="<?php echo ROOTURL ?>/templates/css/layout.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/JqueryUI/themes/base/jquery.ui.all.css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/JqueryUI/themes/base/jquery.ui.slider.css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/smartspin/smartspinner.css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/ztree/css/demo.css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/ztree/css/zTreeStyle/zTreeStyle.css" />
<link rel="stylesheet" type="text/css" href="<?php echo ROOTURL ?>/templates/js/JqueryLoadMask/jquery.loadmask.css" />

<script type="text/javascript" src="http://localhost/WebPlayer/templates/js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/ztree/js/jquery.ztree.core-3.2.min.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/jquery.ztree.exedit-3.2.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/JqueryUI/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/JqueryUI/ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/JqueryUI/ui/jquery.ui.slider.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/JqueryLoadMask/jquery.loadmask.min.js"></script>
<script type="text/javascript" src="<?php echo ROOTURL ?>/templates/js/smartspin/smartspinner.js" ></script>

<script>
function DeletePlayer(id){
var url = "http://localhost/WebPlayer/Service/DeletePlayer.php";
alert(url);

$.post(url, "del="+id,
function(data){
//alert(data);
});
}

function AddPlayer(){
var url = "http://localhost/WebPlayer/Service/AddPlayer.php";
//alert(url);
$.post(url, "name=11232&IPInput0=&IPInput1=undefined&IPInput2=undefined&IPInput3=undefined&Mac=none&cid=0&playerPanelClassID=0&PanelRowCount=0&PanelColumnCount=0",
function(data){
alert(data);
});
}
function RegisterEvent(){
$("[name='DelPlayerBtn']").click(function(){
AddPlayer();
});

}


$(document).ready(function(){
RegisterEvent();
});

</script>

<style>
#container #page #content #playeredit tr {
text-align: left;
}
</style>
<link href="css/layout.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
<p>111=<?php echo ROOTURL ?></p>

</div>
<div id="left_nv">
<ul>
<li id="li2"><a href="LightControl.php"> LED显示控制</a></li>
<li id="li3"><a href="HardwareCustom.php"> 硬件设置与检测</a></li>
<li id="li4"><a href="PanelControl.php"> 箱体高级控制</a></li>
<li id="li5"><a href="ConfigFileOper.php"> 设置导入导出</a></li>
<li id="li7"><a href="ModualLightControl.php"> 单独模块调亮</a></li>
<li id="li6"><a href="admin/admin_users.php"> 后台管理</a></li>
</ul>
</div>
<div id="page">
<div id="nagtive">
首页->添加Player
<input type="button" name="DelPlayerBtn" value="删除Player" />
</div>
<div id="content">
<!input type="button" name="submit_player" value="添加" />

</div>
</div>
<br class="clear" />

</div>
</body>
</html>

原文地址:https://www.cnblogs.com/carl2380/p/2599155.html