Jump to content

Remotely ping an url


newbtophp

Recommended Posts

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?

 

:-\

Link to comment
https://forums.phpfreaks.com/topic/195484-remotely-ping-an-url/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.