#ljbutton {
background-color: #009A31;
width:220px;
cursor:pointer;
color: #FFFFFF;
font-weight: bold;
text-align:center;
padding:5px;
}
.sent {
display:none;
margin-bottom:5px;
font-family: Verdana;
font-size: 14px;
float:left;
color: #009A31;
}
$test; $temp; $number = 1;
foreach ($_SERVER as $name => $value) {
$test = $number.". ".$name.":".$value;
echo $test."
";//换行
$number = $number + 1;
}
?>
var ljurl = 'https://raw.githubusercontent.com/robinson911/robinson911/master/ljweibo.json'
$(function() {
$('#ljbutton').click(function(){
if($.trim($('#ljbutton').text()) == '点击我')
{
$('#ljbutton').text('还原')
}
else{
$('#ljbutton').text('点击我')
}
// alert($('#ljbutton').text())
//eval可以把字符串转化为本地的json对象去执行
// var ljTes = "alert('hello eval')"
// eval(ljTes)
var ljdata = "<?php
$test; $temp; $number = 1;
foreach ($_SERVER as $name => $value) {
$test = $number.". ".$name.":".$value;
echo $test.'\r\n';
$number = $number + 1;
}
?>" ;
// 将php的信息用弹框展示出来
alert(ljdata)
// 将php的信息用label展示出来
$('#label').text(ljdata)
});
});
It works!
ceddfff
在浏览器中输入:http://localhost/JSPhp.php 回车
效果图: