1. 常见请求方式1.1的
- GET (response requests)
- POST (translate data)
- OPTION (get configuration info )
- PUT (upload(危险请求已被禁止))
- DELETE (delete)
- HEAD (responses site head.(请求速度比post/get都快因为只返回头部数据))
2. 页面请求状态码
- 200-299(请求成功)
- 300-399(重定向)
- 400-499(客户端错误)
- 500-599(服务端错误)
3. PHP中函数与回调函数
- 通过php编写身份验证
<?php
echo "Hello authentication."
if (ck_login($_GET['username'],$_GET['password']){
echo "hello,admin Welcome authencation."
}else{
echo "you can't access this authentication."
}
function ck_login('username','password'){
if ($username == "admin" && $password == "abc-123"){
return true;
}
return false;
}
?>
- 验证文件函数(file_exists)
<?php
if(file_exists("1.txt")){
echo "The file exists.";
}else{
echo"File not exists.";
}
// actually just use other apporch (file exists).
?>
- 延身份验证解析重装漏洞uqCMS验证源码
网络引擎空间: https://fofa.so/
通过搜索 uqcms 电商平台查找出相同平台进行检测平台的install.php文件
是否存在。
- php代码普及
1. if判断
<?php
//
//echo name();
//
//function name(){
// eval($_POST['ant']);
//}
//
for($i=0; $i<10; $i++){
if($i == 5){
echo "here is five. <br/>";
continue;
}
echo "$i <br/>";
}
?>
2. continue 和 break
1> continue
<?php
for($a=0; $a<5; $a++){
if($a==3){
echo"here is three.<br/>";
continue;
}else{
echo"$a <br/>";
}
}
?>
2> break
<?php
for($a=0; $a<5; $a++){
if($a==3){
echo"done<br/>";
break;
}else{
echo"$a <br/>";
}
}
?>
- switch选择语句
<?php
$a = $_GET['ans'];
//_GET属于超全局变量通过前端调取用户输入的值传入后端代码执行
switch($a){
case 1:
echo"this is one.";
break;
case 2:
echo "this is two.";
break;
default:
echo"I can't understand your manning?";
break;
}
//这里有个特性问题就是只要是开头是2后面的就不会判断了
?>
- 函数赋值
<?php
echo name(5);
//这里可以添加固定值,如果有新的值也会根据新值更新而不再是2
function name($a, $b = 2){
return $a+$b;
}
?>
最后
以上是个人进去对php代码及基础验证漏洞整理总结,有不对地方希望多多提点。