1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

upload images code request

Discussion in 'PHP' started by crazy.works, Feb 17, 2009.

  1. #1
    hello ,
    i wanna put images upload code in my site which i can put it with believing that it is strong code with no upload bugs, i have that code put it is not good enough .
    SEMrush
    
    $name = $_FILES['imagefile']['name'];
    $nameCC = explode('.', $name);
    if (count($nameCC) > 1)$nameC = 0;
    if ( $_FILES ['imagefile' ][ 'type' ] == "image/gif" || $_FILES ['imagefile' ][ 'type' ] == "image/jpg" || $_FILES ['imagefile' ][ 'type' ] == "image/pjpeg" ||    $_FILES ['imagefile' ][ 'type' ] == "image/jpeg" || $_FILES ['imagefile' ][ 'type' ] == "image/png" && $name != 0){
    $ar = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
    $imgname = array_rand($ar).rand(99999, 999999999).'.'.$nameCC[1];
    $rtv9 = "upload/".$imgname;
    move_uploaded_file($_FILES['imagefile']['tmp_name'], "upload/".$imgname);
    } else {
    $rtv9 = "upload/2.jpg";
    }
    

    so please any body have strong code with no upload bugs i will be thankful for it .

    thanks
     
    crazy.works, Feb 17, 2009 IP
    SEMrush