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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.