![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
php & form submission control
how can i make it so that a form will only be accepted if its been submitted from the domain that it is hosted on?
could check refering url etc but was wondering if someone knows a more secure way |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2002
Location: Sarasota, FL
Posts: 973
|
i believe reffer is the only other way other then htaccess
__________________
icq: 2721653 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Well you could always have them type in the word.
![]() ![]() ![]() That's one of the things I just added to Strongbox. Were you using CGI instead of damn PHP you could use my library, which would plug right into your script. Matter of fact, now that I've been the one to actually give a decent answer to your question I guess I can go ahead and say: You're concerned about securing it and you're writing it in PHP?!?!?!? ROTFL! FOOMCLMDFHO! (Falling Out Of My Chair Laughing My Damn Fool Head Off).
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Oct 2003
Location: The Netherlands
Posts: 310
|
Quote:
You can only use the referring check like this: Check the refer var stored in: $HTTP_SERVER_VARS['HTTP_REFERER']; $findme = 'www.domain.com'; $pos1 = stripos($HTTP_SERVER_VARS['HTTP_REFERER'], $findme); // Nope, if ($pos1 hahahaha= false) { echo "The string '$findme' was not found in the string '$HTTP_SERVER_VARS['HTTP_REFERER']'"; } // Yes it there Else{ echo "We found '$findme' in '$HTTP_SERVER_VARS['HTTP_REFERER']'"; } replace the echo's after testing by or a new header or the add to db routine... Good Luck ![]()
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
thanks guys... my main concern with using the refer method is that it is not always passed and can be forged pretty easily
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: May 2004
Posts: 118
|
Here's an algorythm:
When displaying the form: 1. Generate a unique number and store it in a database table with a timestamp. 2. Delete all unique numbers older than 2 hours. 3. Hide the new unique number in the form. When processing the form: 1. Check the unique number against the database. If it is not there, die(); 2. Check the refferer. If it is incorrect, die(); 3. Process the form. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Oct 2003
Location: The Netherlands
Posts: 310
|
Quote:
But it brings me a even greater and easier idea... Just start a session in the form and check the sessions id in the submit routine... if not there send them to the form on the server with a header.... ![]()
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
Quote:
essentially im thinking of issuing the form a one-time licence... each time the form is issued a new licence is generated.... maybe not tied to the session id as this could be easily obtained |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Oct 2003
Location: The Netherlands
Posts: 310
|
Quote:
What kind of license.... You could generate a unique number and store it like a session variable.. I don't think they can obtained that very easy....
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Cant you do like perl and just set the permissions?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
Quote:
i was thinking of encoding something like the time and a key value... still havent thought this bit out fully... but the licence would be unique for the time that it was generated... the key would never be transmitted.... when the form is submitted decrypt the licence.... not sure if all this is redudant though |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Quote:
For example you dont want somebody to copy the HTML of your form and modify it so they can exploit your script or what not. I dont know exactly what you are doing but I prevent this simply by setting the permissions correctly for the script. Prehaps I dont fully understand what you are trying to do.. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
use session_id . Works better.
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Join Date: Feb 2002
Posts: 1,424
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Quote:
http://www.perlfect.com/articles/chmod.shtml Prehaps this can help you |
|
![]() |
![]() ![]() ![]() ![]() ![]() |