A beginner in php asks a question when I look at the source code of a function. First, there is a function functionSubmitCheck ($ var & quot ;) {if (empty ($ _ POST) {returnfalse;} if ($ _ SERVER [REQUEST_METHOD] POST & amp; (empty ($ _ SERVE php beginner asks a function
When I look at the source code, I have a question: First, there is such a function.
Function SubmitCheck ($ var = ""){
If (empty ($ _ POST )){
Return false;
}
If ($ _ SERVER ['request _ method'] = 'post' & (empty ($ _ SERVER ['http _ referer']) |
Preg_replace ("/https? : \/([^ \: \/] + ). */I "," \ 1 ", $ _ SERVER ['http _ referer']) = preg_replace ("/([^ \:] + ). */"," \ 1 ", $ _ SERVER ['http _ host']) {
Return true;
}
Else {
Return false;
}
}
What is this function? just give me a simple answer. thank you.
Also, the return value of this function is Boolean, but why do I find this call below: submitcheck ('islogin') = 'yes', and it can be run?
------ Solution --------------------
Did you send two identical questions at once?
------ Solution --------------------
SubmitCheck indicates that the content transmitted through POST is not empty, and the source of access is the local server (the running server of the program ),
If the function returns true, otherwise false is returned, which is a function to prevent leeching.
Although the return value of the function is Boolean, the PHP engine is compound during compilation. Therefore, submitcheck ('islogin') = 'yes' can run. However, it should not be able to achieve the expected results.