Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Langs

Name: Anonymous 2006-12-04 15:44

You bash on C, C++, Java, Perl, Python, etc. Is there anything /prog/ WON'T bash?

Name: Anonymous 2006-12-04 16:38

lister.php:
-------------------------
<?php

function image_lister_list($imageFolder, $imageFolderURL, $allowedExtensions, $imageWidth, $authLevel){
    $files = scandir($imageFolder);
    $images = array();
    foreach($files as $file) {
        foreach($allowedExtensions as $ext) {
            if((strlen($file)>strlen($ext)) && stristr($file, $ext)){

                array_push($images, $file);
            }
        }
    }
    $item = 0;
    foreach($images as $image){
        echo "<img src=\"" . $imageFolderURL . $image . "\" alt=\"" . $image . "\" width=\"" . $imageWidth . "\" /><br />\n";
        echo "File:" . $image . "&nbsp;&nbsp;&nbsp;&nbsp;";
        if($authLevel < 2){
            echo "<a href=\"index.php?p=delete&index={$item}\"> Delete </a><br /><br />";
        }
        $item += 1;
    }
}

function image_lister_delete($imageFolder, $allowedExtensions){
    if(isset($_GET["index"])){
        $index = $_GET["index"];
        $files = scandir($imageFolder);
        $images = array();
        foreach($files as $file) {
            foreach($allowedExtensions as $ext) {
                if((strlen($file)>strlen($ext)) && stristr($file, $ext)){
                    array_push($images, $file);
                }
            }
        }
        unlink($imageFolder . "\\" . $images[$index]);
    }
}

?>
---------------------------

Name: Anonymous 2006-12-04 16:39

uploader.php:
------------------------------------
<?php

function image_uploader_upload($imageFolder, $imageFolderURL) {
    $targetPath = $imageFolder . "\\" . basename( $_FILES['uploadedfile']['name']);
    $targetURL = $imageFolderURL . basename( $_FILES['uploadedfile']['name']);

    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $targetPath)) {
        echo "The file ".  basename( $_FILES['uploadedfile']['name']).
        " has been uploaded to <a href=\"$targetURL\">$targetURL</a><br />";
    } else{
        echo "There was an error uploading the file, please try again!";
    }
}
?>
-------------------------

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List