I want to get post data only from specific url(s), when someone post to my page some data from unwanted url, my page should not let the data pass. I couldn't find any example or documentation about this control or i'm asking wrong question to google, maybe it is simple but i have never needed such control.
E.g i want to let only paypal to send post data to my page. Hope you can help me. Thanks in advance.
Data is never sent to you by a "domain". I.e., neither "Paypal" nor paypal.com are sending you POST requests; some computer is sending you POST requests. That computer may or may not be under the control of Paypal the company, serve the website paypal.com or be within a network that belongs to Paypal (company or website).
Obviously you cannot programmatically figure out whether the server legally belongs to Paypal the company.
You can figure out what IP address paypal.com has and compare that to the IP address that's sending you POST requests, but this doesn't have to mean anything since Paypal has hundreds or thousands of servers, and the servers that serve paypal.com the website are likely not the same that are working on the backend to handle transactions.
You need to establish some form of trust between Paypal and yourself some other way. Either Paypal will promise to only ever send requests from one specific IP address, which you can check against. Or they promise to send a secret authentication with the request, which only you and Paypal know. Or you'll agree to use SSL client certificates to establish mutual trust. Or Paypal sends some transaction id which only it could know about which you can validate against.