Solved

posting form data

Posted on 2016-10-26
3
56 Views
Last Modified: 2016-10-26
I use PHP and mysql
how can I be sure that if my web form is actually posted from my own server?

I think anyone can send a data to my action page from a different server?

I use https by the way.
0
Comment
Question by:Braveheartli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 41860105
anyone can send a data to my action page from a different server?
Yes, that is one of the built-in risks of the HTTP protocol.  You can't prevent it, but you can make it harmless.

You may consider using a "form token."
https://www.experts-exchange.com/articles/28802/Improved-Form-Tokens-to-Guard-Against-CSRF-and-Screen-Scrapers.html

You can check HTTP_REFERER (It's all explained in the article).  You can also check the input controls.  You will find their names in the array keys of $_POST.  If any are missing or there are any extras, just discard the request.

If you need more protection, consider a CAPTCHA test.
https://www.experts-exchange.com/articles/9849/Making-CAPTCHA-Friendlier-with-Simple-Number-Tests-or-PHP-Image-Manipulation.html
0
 
LVL 1

Author Closing Comment

by:Braveheartli
ID: 41860107
thank you
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 41860122
You're welcome!  Glad to help, ~Ray
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question