Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: How to restrict external form submissions

Status
Not open for further replies.

compweb

Programmer
Aug 10, 2000
21
0
0
US
Have multiple domains sharing an online poll. I want to check the referer to make sure the submssion is coming from one of our domains.
Tried:
<%If Request.ServerVariables(&quot;HTTP_Referer&quot;) Not Like &quot;%mydomain.com%&quot; Then Response.End %>

Using VBscript, want to check for partial domain match. Hope you can see what I'm trying to do.

TIA for any help,
Mitch
 
if inStr(theString,&quot;whatYoureLookingFor&quot;) > 0 then
'it is in there
else
'it is not in there
end if

that function, instr, returns the position of the substring that you specify in the string, theString. So, it the return value from the function is > 0, then it's in there. If it's = 0, then it's not in there.

What you were attempting would be valid in SQL Server.

Here's the same thing as pertains to your situation:


If inStr(Request.ServerVariables(&quot;HTTP_Referer&quot;), &quot;mydomain.com&quot;) = 0 Then
Response.End
end if



Here's some more info on the inStr() function:


hope that helps! :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top