newbtophp Posted March 16, 2010 Share Posted March 16, 2010 I have a site like: domain.com/index.php?del=3554, which when this page is accessed it would delete a file. So I was wondering without me having to visit that url to delete it, is their a way in php to do that for me - i need this since I'd like to delete the file remotely, ie. access that url - so it will delete the file. Anyone can help, i have a few ideas such as cURL, fsockopen? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/195484-remotely-ping-an-url/ Share on other sites More sharing options...
awpti Posted March 16, 2010 Share Posted March 16, 2010 CURL would be the best option.. Not sure what else you expect in an answer on this one. Quote Link to comment https://forums.phpfreaks.com/topic/195484-remotely-ping-an-url/#findComment-1027285 Share on other sites More sharing options...
5kyy8lu3 Posted March 16, 2010 Share Posted March 16, 2010 I have a site like: domain.com/index.php?del=3554, which when this page is accessed it would delete a file. So I was wondering without me having to visit that url to delete it, is their a way in php to do that for me - i need this since I'd like to delete the file remotely, ie. access that url - so it will delete the file. Anyone can help, i have a few ideas such as cURL, fsockopen? :-\ for security reasons you should probably use curl if you wanted some ghetto method, you could just use file_get_contents("http://www.yoursite.com?file=1234"); which causes the server to parse the php, which basically means it runs your code and deletes the file. the only downside is that it's not secure, since anyone who got ahold of your url could start deleting files. you'd want some sort of validation code in the url as well. ?code=SomeHash. but even then it's not secure but it's an option lol. Quote Link to comment https://forums.phpfreaks.com/topic/195484-remotely-ping-an-url/#findComment-1027288 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.