473,473 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Prevent posting

How can I prevent posting of a form from any other site but the site the
form lives on?
Jul 19 '05 #1
11 1363
Might want to look into:

Request.ServerVariables("HTTP_REFERER")

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
How can I prevent posting of a form from any other site but the site the
form lives on?

Jul 19 '05 #2
Set a cookie when the form loads and then check it's value when you submit.

Generate an encrypted number when you display the form, de-crypt it when you
save it and check it's correct.

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
How can I prevent posting of a form from any other site but the site the
form lives on?

Jul 19 '05 #3
James wrote:
Might want to look into:

Request.ServerVariables("HTTP_REFERER")

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
How can I prevent posting of a form from any other site but the site the
form lives on?


Yeah... that's what I was thinking...

Currently the form posts to itself...

On one of the first lines I do a check to see if http_referer = ""

Is that enough?
Jul 19 '05 #4
No, you cannot rely on the referrer any more as some anti-virus/firewall
software stops the browser from sending that information.

You would check to see that the

Request.ServerVariables("HTTP_REFERER") =
"http://www.YourDomain.com/YourFormPage.asp"

You need to set some random value in the form and then check it's there and
valid when you process it. You could do it with a database and the visitors
IP address but it's a bit like overkill.

Regards

David

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:41**************@yahoo.ca...
James wrote:
Might want to look into:

Request.ServerVariables("HTTP_REFERER")

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
How can I prevent posting of a form from any other site but the site the
form lives on?


Yeah... that's what I was thinking...

Currently the form posts to itself...

On one of the first lines I do a check to see if http_referer = ""

Is that enough?

Jul 19 '05 #5
Could you post an example? Or a link?

David Morgan wrote:
No, you cannot rely on the referrer any more as some anti-virus/firewall
software stops the browser from sending that information.

You would check to see that the

Request.ServerVariables("HTTP_REFERER") =
"http://www.YourDomain.com/YourFormPage.asp"

You need to set some random value in the form and then check it's there and
valid when you process it. You could do it with a database and the visitors
IP address but it's a bit like overkill.

Regards

David

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:41**************@yahoo.ca...
James wrote:
Might want to look into:

Request.ServerVariables("HTTP_REFERER")

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
How can I prevent posting of a form from any other site but the site the
form lives on?

Yeah... that's what I was thinking...

Currently the form posts to itself...

On one of the first lines I do a check to see if http_referer = ""

Is that enough?


Jul 19 '05 #6
Hi

Sorry, I just don't have the time, but something like this could be enough
....

Create a PIN.

iPIN = Year(Date) + Month(Date) + Day(Date)
<form .... >
<input type="hidden" name="intPIN" value="<%=iPIN%>"
....
</form>

Form is submitted

iPIN = Year(Date) + Month(Date) + Day(Date)

If iPIN <> CLng(Request.Form("intPIN")) Then
' Not submitted from form
End If

Obviously this would allow any referrer who copied the form 'today' and
also, those who display the form before midnight and post it afterward will
have a problem, but you get the idea.
"Just1Coder" <ju********@yahoo.ca> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
Could you post an example? Or a link?

David Morgan wrote:
No, you cannot rely on the referrer any more as some anti-virus/firewall
software stops the browser from sending that information.

You would check to see that the

Request.ServerVariables("HTTP_REFERER") =
"http://www.YourDomain.com/YourFormPage.asp"

You need to set some random value in the form and then check it's there and valid when you process it. You could do it with a database and the visitors IP address but it's a bit like overkill.

Regards

David

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:41**************@yahoo.ca...
James wrote:

Might want to look into:

Request.ServerVariables("HTTP_REFERER")

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:OP*************@TK2MSFTNGP11.phx.gbl...
>How can I prevent posting of a form from any other site but the site the>form lives on?

Yeah... that's what I was thinking...

Currently the form posts to itself...

On one of the first lines I do a check to see if http_referer = ""

Is that enough?


Jul 19 '05 #7
Ah, I see.

So a random number or GUID or something like that should work OK?

David Morgan wrote:
Hi

Sorry, I just don't have the time, but something like this could be enough
...

Create a PIN.

iPIN = Year(Date) + Month(Date) + Day(Date)
<form .... >
<input type="hidden" name="intPIN" value="<%=iPIN%>"
...
</form>

Form is submitted

iPIN = Year(Date) + Month(Date) + Day(Date)

If iPIN <> CLng(Request.Form("intPIN")) Then
' Not submitted from form
End If

Obviously this would allow any referrer who copied the form 'today' and
also, those who display the form before midnight and post it afterward will
have a problem, but you get the idea.
"Just1Coder" <ju********@yahoo.ca> wrote in message
news:uo**************@TK2MSFTNGP10.phx.gbl...
Could you post an example? Or a link?

David Morgan wrote:
No, you cannot rely on the referrer any more as some anti-virus/firewall
software stops the browser from sending that information.

You would check to see that the

Request.ServerVariables("HTTP_REFERER") =
"http://www.YourDomain.com/YourFormPage.asp"

You need to set some random value in the form and then check it's there
and
valid when you process it. You could do it with a database and the
visitors
IP address but it's a bit like overkill.

Regards

David

"Just1Coder" <ju********@yahoo.ca> wrote in message
news:41**************@yahoo.ca...
James wrote:
>Might want to look into:
>
>Request.ServerVariables("HTTP_REFERER")
>
>"Just1Coder" <ju********@yahoo.ca> wrote in message
>news:OP*************@TK2MSFTNGP11.phx.gbl.. .
>
>
>
>>How can I prevent posting of a form from any other site but the site
the
form lives on?
>
>
>
Yeah... that's what I was thinking...

Currently the form posts to itself...

On one of the first lines I do a check to see if http_referer = ""

Is that enough?


Jul 19 '05 #8
Just1Coder <ju********@yahoo.ca> wrote in message news:<OP*************@TK2MSFTNGP11.phx.gbl>...
How can I prevent posting of a form from any other site but the site the
form lives on?


Set a session variable when the form loads, then make sure the session
var exists when processing the form.
Jul 19 '05 #9
Just1Coder wrote:
How can I prevent posting of a form from any other site but the site
the form lives on?


Why bother?

It sounds like you are attempting to put some of your security on the client
side. This is trivial to defeat. Heck - with the FireFox LiveHTTPHeaders
extension, I can change anything at all in a request and re-send. Anything.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #10
Dave Anderson wrote:
Just1Coder wrote:
How can I prevent posting of a form from any other site but the site
the form lives on?

Why bother?

It sounds like you are attempting to put some of your security on the client
side. This is trivial to defeat. Heck - with the FireFox LiveHTTPHeaders
extension, I can change anything at all in a request and re-send. Anything.

Yes, I know but there are several ways around it, but I have been asked to.

Didn't know about that LiveHTTPHeaders extension though, very cool.
Jul 19 '05 #11
"Just1Coder" <ju********@yahoo.ca> wrote in message
news:u0****************@TK2MSFTNGP14.phx.gbl...
Ah, I see.

So a random number or GUID or something like that should work OK?


Yes, put that random in the session state and check it after a post.
Jul 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
9
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx)...
1
by: Brian | last post by:
Hello - Is there a way to prevent the user from creating a blank row at the bottom of a datagrid? I want a read only grid that allows the user to view data but not select specific cells or...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
3
by: S.M.Deshpande | last post by:
Hi, I have installed DB2 version 8.1 and created two databases, TEST1 and TEST2. Two operating system users test1 and test2 are mapped to two database users in TEST1 and TEST2 databases...
4
by: =?Utf-8?B?QXNhZg==?= | last post by:
Hi, How can I prevent from an ASP.NET page to resend all the data again when the user press the Refresh button or F5 on the browser? Thanks in advanced, Asaf
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.