How do I check whether a string exists in the page URL? In view of security, if you want to obtain the url of this page, check whether the string "script" exists. If yes, access or exit is prohibited. How to implement it ?, Strstrstrpos, youshouldhaveahtmlparser..., how does youshouldhaveahtmlpa check whether a string exists in the page URL?
In view of security, if you want to obtain the url of this page, check whether the string "script" exists. If yes, access or exit is prohibited. How to implement it?
------ Solution --------------------
Strstr strpos
------ Solution --------------------
You shoshould have a html parser...
------ Solution --------------------
You shoshould have a html parser. I suppose there are such php version in the wild.
------ Solution --------------------
PHP code
Function curPageURL () {$ pageURL = 'http'; if ($ _ SERVER ["HTTPS"] = "on") {$ pageURL. = "s" ;}$ pageURL. = ": //"; if ($ _ SERVER ["SERVER_PORT"]! = "80") {$ pageURL. = $ _ SERVER ["SERVER_NAME"]. ":". $ _ SERVER ["SERVER_PORT"]. $ _ SERVER ["REQUEST_URI"];} else {$ pageURL. = $ _ SERVER ["SERVER_NAME"]. $ _ SERVER ["REQUEST_URI"];} return $ pageURL ;}