Results 1 to 5 of 5

Thread: How to check from where its posting ?

  1. #1

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    How to check from where its posting ?

    Hi!

    I have a signup form and i want to make sure that it is being posted from the website only and not from any other location. So how do i determine from where the form is being posted ? I am using POST method.

    Thanks!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: How to check from where its posting ?

    The only real method of doing this is to use a client side image containing letters and numbers. The user must type copy wat is in the image before sending the form. This tutorial explains what you need to do to achieve this:

    http://www.zend.com/zend/tut/tutorial-mehmet1.php
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Red face Re: How to check from where its posting ?

    Hi!

    Hmm no i think i did not explained my question very well, let me re-phrase:

    I have a form signup.htm whcih once filled takes the user to signup.php for processing.

    Now i have certien hidden fields in the form ..which i want that user can't mess up with. So for this when a user posts the form i want to make sure that the form is posted from a certian web addres like my servers's address.

    Can i determine the from where the form is being posted ? Like compare IP address or soemthing ...so if its not my server's ip then its not being posted from the website...!

    Can something like this be done ?

    Thanks!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    Re: How to check from where its posting ?

    Well, you could create a session on the page being posted from and then check to see if the session excits when you check the $_POST array. If it was posted from a different site then the session wouldn't excist unless they somehow postd it from your form first to create the session then left the site and reposted it again.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: How to check from where its posting ?

    Extending Arc's suggestion. If you have hidden data in your form that you don't want change, it is better not to send it in the first place. Create a session and store the hidden data in the session.

    Ensuring the session has not been hijacked is a whole topic in its self. See this post for some tips on how to do this:

    http://www.vbforums.com/showthread.p...68#post1925668
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width