Results 1 to 2 of 2

Thread: Needing help

  1. #1
    Join Date
    Oct 2006
    Posts
    1,026
    Tokens
    0

    Latest Awards:

    Default Needing help

    Ok,

    Can anyone do this for me,

    You ee http://y3d.co.uk upload something how do I get basic.php to be the template if you get what I mean.

    Code

    PHP Code:
    <?
    include "config.php";
    if (!isset(
    $_FILES['userfile'])) exit;
    if (
    is_uploaded_file($_FILES['userfile']['tmp_name'])) {
    if (
    $_FILES['userfile']['size']>$max_size

     echo 
    "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">File is too big !</font><br>\n"; exit; 
    }
    if ((
    $_FILES['userfile']['type']=="image/gif") || ($_FILES['userfile']['type']=="image/pjpeg") || ($_FILES['userfile']['type']=="image/jpeg") || ($_FILES['userfile']['type']=="image/png")) 
    {
    // generate random signs
    $zufall rand(1,9);
    $zufall2 rand(1,26);
    $buchstaben = array(  "1" => "arx",
        
    "2" => "opt",
        
    "3" => "bwy",
        
    "4" => "cqs",
        
    "5" => "viu",
        
    "6" => "rgh",
        
    "7" => "jdv",
        
    "8" => "klz",
        
    "9" => "bfi", );
    $buchstaben2 = array( "1" => "a",
        
    "2" => "b",
        
    "3" => "c",
        
    "4" => "d",
        
    "5" => "e",
        
    "6" => "f",
        
    "7" => "g",
        
    "8" => "h",
        
    "9" => "i",
        
    "10" => "j",
        
    "11" => "k",
        
    "12" => "l",
        
    "13" => "m",
        
    "14" => "n",
        
    "15" => "o",
        
    "16" => "p",
        
    "17" => "q",
        
    "18" => "r",
        
    "19" => "s",
        
    "20" => "t",
        
    "21" => "u",
        
    "22" => "v",
        
    "23" => "w",
        
    "24" => "x",
        
    "25" => "y",
        
    "26" => "z", );
    $unikat $buchstaben[$zufall] . time() . $buchstaben2[$zufall2];
    // upload progress
    $file $_FILES['userfile']['name'];
    $new_bild $unikat.substr($filestrrpos($file"."));
    $res move_uploaded_file($_FILES['userfile']['tmp_name'], "./" $path $new_bild);
    if (!
    $res

     echo 
    "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">Didn't work, please try again</font><br>\n"; exit; 

    else 
    {
    ?>
    <br>
    <?
    //set url variables
    $imgf $new_bild;
    $thbf $tpath.$imgf;
    $urlf 'http://' .$domain .'/' .$path .$imgf;
    //create thumbnails
    function createthumb($name,$filename,$new_w,$new_h)
    {
    $system=explode('.',$name);
    if (
    preg_match('/jpg|jpeg|JPG/',$system[1]))
    {
     
    $src_img=imagecreatefromjpeg($name);
    }
    if (
    preg_match('/png|PNG/',$system[1]))
    {
     
    $src_img=imagecreatefrompng($name);
    }
    if (
    preg_match('/gif|GIF/',$system[1]))
    {
     
    $src_img=imagecreatefromgif($name);
    }
    $old_x=imageSX($src_img);
    $old_y=imageSY($src_img);
    if (
    $old_x $old_y
    {
     
    $thumb_w=$new_w;
     
    $thumb_h=$old_y*($new_h/$old_x);
    }
    if (
    $old_x $old_y
    {
     
    $thumb_w=$old_x*($new_w/$old_y);
     
    $thumb_h=$new_h;
    }
    if (
    $old_x == $old_y
    {
     
    $thumb_w=$new_w;
     
    $thumb_h=$new_h;
    }
    $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
    imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 
    if (
    preg_match("/png/",$system[1]))
    {
     
    imagepng($dst_img,$filename); 

    if (
    preg_match("/gif/",$system[1]))
    {
     
    imagegif($dst_img,$filename);
    }
    else 
    {
     
    imagejpeg($dst_img,$filename); 
    }
    imagedestroy($dst_img); 
    imagedestroy($src_img); 
    }
    createthumb($path.$imgf,$tpath.$imgf,$tsize,$tsize);
    ?>
    <head>
    <script type="text/javascript">
    <!--
    function highlight(field)
     {
     field.focus();
     field.select();
     }
    //-->
    </script>
    <title>EasyImageHoster - www.imagehoster.6x.to</title>
    </head>
    <body bgcolor="#272f80" background='background.gif'>
    <center>
    <table border='0' bgcolor='white'>
    <link rel="STYLESHEET" type="text/css" href="style.css">
    <FORM action="nowhere" method="post">
    <center>
    <tr><td>URL:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value="<? echo 'http://' .$domain .'/' ?>viewer.php?id=<? echo $imgf?>"></td></tr>
    <tr><td>DIRECT URL:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value="<? echo $urlf?>"></td></tr>
    <tr><td>HTML:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value='<a href="<? echo 'http://' .$domain .'/'?>viewer.php?id=<? echo $imgf?>"><img src="<? echo 'http://' .$domain.'/'.$tpath.$imgf?>" border="0"></a>'></td></tr>
    <tr><td>BBCode:</td><td><input type="text" name="thetext" onClick='highlight(this);' size="60" value="[URL=<? echo 'http://' .$domain .'/'?>viewer.php?id=<? echo $imgf?>][IMG]<? echo 'http://' .$domain.'/'.$tpath.$imgf?>[/IMG][/URL]"></td></tr>
    <tr><td>IMAGE:</td><td><a href='viewer.php?id=<? echo $imgf?>'><img src='<? echo $thbf ?>'></a></td></tr>
    <?
    }

    else 

    echo 
    "<font color=\"#333333\" face=\"Geneva, Arial, Helvetica, sans-serif\">You selected a wrong filetype!</font><br>\n"; exit; 
    }
    }
    if (
    $tsize <= 380
    {
     echo 
    "</table>";
     echo 
    "<table border='0' bgcolor='white' width='457'>";
     echo 
    "<tr><td><center><a href='./index.php'>back</a></td></tr>";
     echo 
    "</table>";
     echo 
    "<br><br>";
     echo 
    "</body>";
    }
    ?>
    Edited by L&#181;ke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks .
    Last edited by Lµke; 19-02-2007 at 02:48 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    say in more detail :S
    EDTALKING


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •