Monday, 15 September 2014

php - Checking requesting script url in SOAP -



php - Checking requesting script url in SOAP -

i have basic soap server:

$soap = new soapserver(null, array('uri' => '')); $soap->addfunction('myfunction'); if ($_server['request_method'] == 'post') { $soap->handle(); } else { echo "available functions:"; foreach ($soap->getfunctions() $func) { echo "\n\t" . $func; } }

now, have specific set of domains (that own) expect requests, , no others - in array:

$allowed_domains = array('http://www.example.com', 'http://www.otherexample.com');

how create 'whitelist', in domains can create request soap server script (any others denied access)?

thank you!

the check can follow :

if(!in_array($_server['http_referer'], $allowed_domains) { // operation denied exit 0; }

hope helps :)

php soap

No comments:

Post a Comment