d.shankar Posted September 20, 2008 Share Posted September 20, 2008 Hi freaks ! I am stuck up in a crossdomain issue i suppose :-\ I have a file in a remote server that displays that has the code like this <?php $var=$_GET['val']; echo $var; ?> Assume that this file can be accessed by www.remotedomain.com/test.php?val=12345 Now i need to access this file from my domain www.mydomain.com using cURL by sending the variable 12345 so that it processes and gets displayed into my page. <?php $nh=curl_init(); curl_setopt ($nh, CURLOPT_URL,"http://www.remotedomain.com/test.php?val=12345"); curl_setopt ($nh, CURLOPT_RETURNTRANSFER,1); curl_setopt ($nh, CURLOPT_SSL_VERIFYPEER,false); curl_setopt ($nh, CURLOPT_TIMEOUT,15); $source = curl_exec($nh); echo $source; ?> I have uploaded.. crossdomain.xml file in remote server too.. But when i run this code, i get a 403 forbidden error page. Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/ Share on other sites More sharing options...
ratcateme Posted September 20, 2008 Share Posted September 20, 2008 can you put http://www.remotedomain.com/test.php?val=12345 into your web browser and get 12345 are there settings in the apache on remotedomain that could be stopping your request? Scott. Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646268 Share on other sites More sharing options...
d.shankar Posted September 20, 2008 Author Share Posted September 20, 2008 http://www.remotedomain.com/test.php?val=12345 from the browser works great..ratcat.. But my code works when i run from localhost to connect this remotes server , but when i put the same code in my domain it does work and gives me a 403 ! Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646281 Share on other sites More sharing options...
ratcateme Posted September 20, 2008 Share Posted September 20, 2008 have you check the config settings on remotedomain.com it sounds like there is a rule denying mydomain.com to access it? Scott. Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646282 Share on other sites More sharing options...
d.shankar Posted September 20, 2008 Author Share Posted September 20, 2008 What is that option ? Can i change that in php.ini ? But how come my localhost access it without any problem ? Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646283 Share on other sites More sharing options...
ratcateme Posted September 20, 2008 Share Posted September 20, 2008 it would be in the web server app you are properly running apache or something it might have some kind of setting in the config file like deny all allow ip_of_your_localhost or allow all deny ip_of_mydomain.com Scott. Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646284 Share on other sites More sharing options...
d.shankar Posted September 20, 2008 Author Share Posted September 20, 2008 But in the beggining of the post itself i specified that i have added crossdomain.xml file. crossdomain.xml <cross-domain-policy> <allow-access-from domain="*"/> </cross-domain-policy> Why still i am getting the problem ? Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646285 Share on other sites More sharing options...
ratcateme Posted September 20, 2008 Share Posted September 20, 2008 hmm that is kinda strange try making it <allow-access-from domain="*.remotedomain.com"/> Scott. Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646287 Share on other sites More sharing options...
d.shankar Posted September 20, 2008 Author Share Posted September 20, 2008 Still the same problem Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-646288 Share on other sites More sharing options...
d.shankar Posted September 21, 2008 Author Share Posted September 21, 2008 Bump1 Link to comment https://forums.phpfreaks.com/topic/125050-403-forbidden/#findComment-647017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.