Using ASP can reduce the workload of the server, so you should use javascript more and submit all submission fields to the server after using javascript or detection, so that the server does not need detection. Today, let the new technology channel editor will take you to learn examples and demonstrate prohibiting off-site submission forms!
The code copy is as follows:<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "
| " response.write "The path you submitted is incorrect. You are prohibited from submitting data from outside the site. Please do not mess with this parameter!" response.write " | style='font:9pt verdana'>
response.end
end if
%>
For example, the above code is named check_path.asp to save, and it is enough to reference every time the form is submitted:
The above codes are all wrong. The examples collected by the editor of the New Technology Channel for you are prohibited from submitting forms outside the site. I hope it will be of some help to everyone’s learning!