FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

200 frih$ for simple Script

 


{name here}
I need a PHP/Perl script that will ask for the name of a file on the server and then delete it. You will get 200 frih$ for this script.
ncwdavid
Where are the files stored. Is it using mysql?
the zephyrus
Seeing as you're asking for someone to make this specifically, I assume you understand the security risks you open up.

I'm kinda new to this. So it's not gonna be that great.

USE THIS AT YOUR OWN RISK.

That said,

Code:
<!--
this file should be named
deleter.php

WARNING:
EXTREMELY UNSAFE
USE AT OWN RISK
-->

<html>

<head>
<title>File Deleter</title>
</head>

<body>

<form name="deleteform" action="deleter.php" method="post">
File to delete:<br>
<input type="text" name="myfile"><br>
You sure? (type 'yes')<br>
<input type="text" name="doublecheck"><br>
Okay, then.<br>
<input type="sumbit" name="DoIt"><br>
</form>

<hr>

<?php

if ($_POST['myfile'] && $_POST['doublecheck'] === 'yes') {
   $thefile = $_POST['myfile'];
   $thefile = str_replace('/','',$thefile);
   $thefile = str_replace('\\','',$thefile);
   if (unlink($thefile)) {
      echo("We were successful. $thefile was deleted.");
   } else {
      echo("Failed to delete $thefile unfortunately.");
   }
}

?>

</body>

</html>
{name here}
the zephyrus wrote:
Seeing as you're asking for someone to make this specifically, I assume you understand the security risks you open up.

I'm kinda new to this. So it's not gonna be that great.

USE THIS AT YOUR OWN RISK.

That said,

Code:
<!--
this file should be named
deleter.php

WARNING:
EXTREMELY UNSAFE
USE AT OWN RISK
-->

<html>

<head>
<title>File Deleter</title>
</head>

<body>

<form name="deleteform" action="deleter.php" method="post">
File to delete:<br>
<input type="text" name="myfile"><br>
You sure? (type 'yes')<br>
<input type="text" name="doublecheck"><br>
Okay, then.<br>
<input type="sumbit" name="DoIt"><br>
</form>

<hr>

<?php

if ($_POST['myfile'] && $_POST['doublecheck'] === 'yes') {
   $thefile = $_POST['myfile'];
   $thefile = str_replace('/','',$thefile);
   $thefile = str_replace('\\','',$thefile);
   if (unlink($thefile)) {
      echo("We were successful. $thefile was deleted.");
   } else {
      echo("Failed to delete $thefile unfortunately.");
   }
}

?>

</body>

</html>

I'll send some frih$ your way. Thanks.
Reply to topic    Frihost Forum Index -> Miscellaneous -> Marketplace

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.