php编程基础知识
$conn=mysql_connect($mysql_server_name,$mysql_username,$mysql_password) or die("error connecting") ; //连接数据库
mysql_query("set names 'gb2312'"); //数据库输出编码 应该与你的数据库编码保持一致
mysql_select_db($mysql_database); //打开数据库
$sql2 ="select * from hezuoshangjia order by id asc "; //SQL语句
$result2 = mysql_query($sql2,$conn); //查询
$num_rows2 = mysql_num_rows($result2);//记录总数
$sql3 ="select * from shijianduan where shiyong like '%1%' order by id asc "; //SQL语句
$result3 = mysql_query($sql3,$conn); //查询
$num_rows =mysql_num_rows($result3);//记录总数
$ipdz=$_SERVER["REMOTE_ADDR"];//获取ip
echo "今天:".date("Y/m/d")."<br>";
echo "昨天:".date("Y/m/d",strtotime("-1 day")), "<br>";
echo "明天:".date("Y-m-d",strtotime("+1 day")). "<br>";
echo "一周后:".date("Y-m-d",strtotime("+1 week")). "<br>";
echo "一周零两天四小时两秒后:".date("Y-m-d G:H:s",strtotime("+1 week 2 days 4 hours 2 seconds")). "<br>";
echo "下个星期四:".date("Y-m-d",strtotime("next Thursday")). "<br>";
echo "上个周一:".date("Y-m-d",strtotime("last Monday"))."<br>";
echo "一个月前:".date("Y-m-d",strtotime("last month"))."<br>";
echo "一个月后:".date("Y-m-d",strtotime("+1 month"))."<br>";
echo "十年后:".date("Y-m-d",strtotime("+10 year"))."<br>";
$sql3 ="select * from lackeeden where ddtime like '%".date('Y/m/d')."%';"; //SQL语句
$result3 = mysql_query($sql3,$conn); //查询
$num_rows3 = mysql_num_rows($result3);//记录总数
$nowtime=date("Y-m-d H:i:s");
//标准时间转为时间戳
$dateline=strtotime($nowtime);
//时间戳转为标准时间
$nowtime=date('Y-m-d',$dateline);
echo $nowtime;/xxxx; };
echo "<script>location.href='".$_SERVER["HTTP_REFERER"]."';</script>"; };
php 模拟提交 短信用的
$post_data =
array(
'cclist=5AAAA',
'date=0',
'irname=',
'fullpath=',
);
$post_data = implode('&',$post_data);
$url='http://mathuat.us/check/shopavon.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
ob_start();
curl_exec($ch);
$result = ob_get_contents() ;
ob_end_clean();
echo $result;
<script src="//cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
<script src="//res.layui.com/lay/lib/layer/build/layer.js?v=3.03"></script>
<script>
layer.alert('查询结果为空,请查询其他关键字', {icon: 6});
</script>
$jsoninfo = json_decode($output,true);
$access_token = $jsoninfo["access_token"];
limit 10 返回10条记录
mysql_query("set names 'gb2312'"); //数据库输出编码 应该与你的数据库编码保持一致
mysql_select_db($mysql_database); //打开数据库
$sql2 ="select * from hezuoshangjia order by id asc "; //SQL语句
$result2 = mysql_query($sql2,$conn); //查询
$num_rows2 = mysql_num_rows($result2);//记录总数
$sql3 ="select * from shijianduan where shiyong like '%1%' order by id asc "; //SQL语句
$result3 = mysql_query($sql3,$conn); //查询
$num_rows =mysql_num_rows($result3);//记录总数
$ipdz=$_SERVER["REMOTE_ADDR"];//获取ip
echo "今天:".date("Y/m/d")."<br>";
echo "昨天:".date("Y/m/d",strtotime("-1 day")), "<br>";
echo "明天:".date("Y-m-d",strtotime("+1 day")). "<br>";
echo "一周后:".date("Y-m-d",strtotime("+1 week")). "<br>";
echo "一周零两天四小时两秒后:".date("Y-m-d G:H:s",strtotime("+1 week 2 days 4 hours 2 seconds")). "<br>";
echo "下个星期四:".date("Y-m-d",strtotime("next Thursday")). "<br>";
echo "上个周一:".date("Y-m-d",strtotime("last Monday"))."<br>";
echo "一个月前:".date("Y-m-d",strtotime("last month"))."<br>";
echo "一个月后:".date("Y-m-d",strtotime("+1 month"))."<br>";
echo "十年后:".date("Y-m-d",strtotime("+10 year"))."<br>";
$sql3 ="select * from lackeeden where ddtime like '%".date('Y/m/d')."%';"; //SQL语句
$result3 = mysql_query($sql3,$conn); //查询
$num_rows3 = mysql_num_rows($result3);//记录总数
$nowtime=date("Y-m-d H:i:s");
//标准时间转为时间戳
$dateline=strtotime($nowtime);
//时间戳转为标准时间
$nowtime=date('Y-m-d',$dateline);
echo $nowtime;/xxxx; };
echo "<script>location.href='".$_SERVER["HTTP_REFERER"]."';</script>"; };
php 模拟提交 短信用的
$post_data =
array(
'cclist=5AAAA',
'date=0',
'irname=',
'fullpath=',
);
$post_data = implode('&',$post_data);
$url='http://mathuat.us/check/shopavon.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
ob_start();
curl_exec($ch);
$result = ob_get_contents() ;
ob_end_clean();
echo $result;
<script src="//cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
<script src="//res.layui.com/lay/lib/layer/build/layer.js?v=3.03"></script>
<script>
layer.alert('查询结果为空,请查询其他关键字', {icon: 6});
</script>
$jsoninfo = json_decode($output,true);
$access_token = $jsoninfo["access_token"];
limit 10 返回10条记录
版权声明:若无特殊注明,本文皆为《
傲世零零 》原创,转载请保留文章出处。
本文链接:php编程基础知识 http://www.wangjunjiang.com/?post=87
正文到此结束