Menggunakan file field - URL web dan Tutorial - Publisher - Royz Rambo
Ilham Penta
Site menu
Section categories
My articles [6]
Java [14]
Java Programming
Flash [6]
Flash
URL web dan Tutorial [29]
Petualangan [1]
Our poll
Rate my site
Total of answers: 19
Statistics

Total online: 1
Guests: 1
Users: 0
Login form
Main » Articles » URL web dan Tutorial

Menggunakan file field
Suatu ketika form index tidak dapat melembar nilai dari file field, ternyata kurang script 
enctype="multipart/form-data" 

pada form.

"upload.php".
<form enctype="multipart/form-data" action="upload.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="50000" /> Select a File:<br /> <input type="file" size="20" name="thefile" /><br /> <input type="submit" name="Submit" value="Submit" /> </form>

UPLOAD HANDLER

if(array_key_exists('thefile', $_FILES)) { // Validate the uploaded file if($_FILES['thefile']['size'] === 0 || empty($_FILES['thefile']['tmp_name'])) { echo("<p>No file was selected.</p>\r\n"); } else if($_FILES['thefile']['size'] > 50000) { echo("<p>The file was too large.</p>\r\n"); } else if($_FILES['thefile']['error'] !== UPLOAD_ERR_OK) { // There was a PHP error echo("<p>There was an error uploading.</p>\r\n"); } else { // Create uploads directory if necessary if(!file_exists('uploads')) mkdir('uploads'); // Move the file if(move_uploaded_file($_FILES['thefile']['tmp_name'], 'uploads/' . $_FILES['thefile']['name'])) { echo("<p>File uploaded successfully!</p>\r\n"); } else { echo("<p>There was an error moving the file.</p>\r\n"); } } }


Source: http://www.dbscripts.net/tutorials/php-file-upload/
Category: URL web dan Tutorial | Added by: penta (2011-10-12)
Views: 17024 | Comments: 9 | Tags: PHP, file field | Rating: 0.0/0
Total comments: 8
8  
http://cheapamoxilfromcanada.com/#8880 novamoxin amoxicillin trihydrate penicillin allergy http://cheappropeciafromcanada.com/#5430 buy propecia downloadable without prescription

7  
http://cheappropeciafromcanada.com/#4009 propecia cost nz finasteride 1mg http://cheapamoxilfromcanada.com/#6843 clavamox information amoxicillin clavulanate

6  
4174 viagra tote http://apothekeeurode.com/#6201 viagra therapie 3274 viagra horn alternativa naturale http://farmaciaeuroit.com/#2656 viagra a stomaco vuoto se

5  
como tomar sildenafil antes de 6885 http://eufarmaciaes.com/#0223 sildenafil mujer disfunción eréctil viagra oppure retinite pigmentosa 4862 http://eufarmaciait.com/#6444 problemi di disfunzione erettile 2612 erector sildenafil acheter viagra http://viagraprix-france.com/#4714 bifort sildenafil viagra achat

4  
http://www.tekila-et-ses-amis.net/ 54496846444 http://www.hd-digitalsat.com/ 17555075493 http://www.isabelmarantsneakerspascher.info/
Hello. And Bye.

3  
hcg diet plan 9383 http://hcgdietbestnow.com/#5460 hcg diet plan menu

2  
pregnancy success stories buy clomid 3431 http://clomidbestprice.com/#1967 generic clomid at lowes

1  
Кто и где организовать этим летом в отпуске, часть нужной информации.

Name *:
Email *:
Code *:
Search
Site friends
  • Create a free website
  • Copyright Penta.Inc © Powered By: Senjapala