php contact form multi upload

Salam, adi contact form hazırlamışam, ona multi upload quşmaq istəyirəm. bunu necə edə bilərəm? ya da hazır multi upload dəstəyi olan contact form bilirsiniz?


Yadda saxlama
Kateqoriya: Sual . , , . Qısa keçid.

Verilmiş cavablar və yazılan şərhlər (2 cavab var)

(17:36, 26/05/2014 ) #41686

Google
http://google.com/search?q=multi+upload+form+script+php

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(18:47, 26/05/2014 ) #41690
<?php

$valid_formats = array("jpg", "png", "gif", "zip", "bmp"); //icaze verilmis farmatlar
$max_file_size = 1024*100; //100 kb
$path = "uploads/"; // Upload qovluq
$count = 0;

if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
	// Loop $_FILES to execute all files
	foreach ($_FILES['files']['name'] as $f => $name) {     
	    if ($_FILES['files']['error'][$f] == 4) {
	        continue; // Skip file if any error found
	    }	       
	    if ($_FILES['files']['error'][$f] == 0) {	           
	        if ($_FILES['files']['size'][$f] > $max_file_size) {
	            $message[] = "$name is too large!.";
	            continue; // Skip large files
	        }
			elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){
				$message[] = "$name is not a valid format";
				continue; // Skip invalid file formats
			}
	        else{ // No error found! Move uploaded files 
	            if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$name)) {
	            	$count++; // Number of successfully uploaded files
	            }
	        }
	    }
	}
}
?>

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Multiple File Upload with PHP - Demo</title>
<style type="text/css">
a{ text-decoration: none; color: #333}
h1{ font-size: 1.9em; margin: 10px 0}
p{ margin: 8px 0}
*{
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	-moz-font-smoothing: antialiased;
	-o-font-smoothing: antialiased;
	font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
body{
	font: 12px Arial,Tahoma,Helvetica,FreeSans,sans-serif;
	text-transform: inherit;
	color: #333;
	background: #e7edee;
	width: 100%;
	line-height: 18px;
}
.wrap{
	width: 500px;
	margin: 15px auto;
	padding: 20px 25px;
	background: white;
	border: 2px solid #DBDBDB;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	overflow: hidden;
	text-align: center;
}
.status{
	/*display: none;*/
	padding: 8px 35px 8px 14px;
	margin: 20px 0;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
	color: #468847;
	background-color: #dff0d8;
	border-color: #d6e9c6;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}
input[type="submit"] {
	cursor:pointer;
	width:100%;
	border:none;
	background:#991D57;
	background-image:linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
	background-image:-moz-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
	background-image:-webkit-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
	color:#FFF;
	font-weight: bold;
	margin: 20px 0;
	padding: 10px;
	border-radius:5px;
}
input[type="submit"]:hover {
	background-image:linear-gradient(bottom, #9C215A 0%, #A82767 52%);
	background-image:-moz-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
	background-image:-webkit-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
	-webkit-transition:background 0.3s ease-in-out;
	-moz-transition:background 0.3s ease-in-out;
	transition:background-color 0.3s ease-in-out;
}
input[type="submit"]:active {
	box-shadow:inset 0 1px 3px rgba(0,0,0,0.5);
}
</style>

</head>
<body>
	<div class="wrap">
		<h1><a href="http://www.w3bees.com/2013/02/multiple-file-upload-with-php.html">Multiple File Upload with PHP</a></h1>
		<?php
		# error messages
		if (isset($message)) {
			foreach ($message as $msg) {
				printf("<p class='status'>%s</p></ br>\n", $msg);
			}
		}
		# success message
		if($count !=0){
			printf("<p class='status'>%d files added successfully!</p>\n", $count);
		}
		?>
		<p>Max file size 100kb, Valid formats jpg, png, gif</p>
		<br />
		<br />
		<!-- Multiple file upload html form-->
		<form action="" method="post" enctype="multipart/form-data">
			<input type="file" name="files[]" multiple="multiple" accept="image/*">
			<input type="submit" value="Upload">
		</form>
</div>
</body>
</html>

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

Bu suala aid öz sualım var:
Sual verin
Bu suala cavab vermək istəyirəm:
Cavab verin

Cavab verin


Cavab yazmaq üçün lütfən sağ sütundan və ya buradan hesaba daxil olun.

Üzvlər üçün giriş

Qeydiyyat

Elan qutusu

Son cavablar və şərhlər

MiMov cavab verdi - Özəl ip tv qurmaq (3 gün əvvəl)

MiMov cavab verdi - iptv onlayn paket almaq (3 gün əvvəl)

E. Hacı cavab verdi - 300$ Gömrük Limitini keçdim (10 gün əvvəl)

Software Developer cavab verdi - Aliexpress gömrük rüsumu nəyə görə hesablanır? (11 gün əvvəl)

AliyevYT cavab verdi - Honeygain, passiv gelir (12 gün əvvəl)

Sıradan biri cavab verdi - IMEI qeydiyyatı (14 gün əvvəl)

Fariz Huseynli cavab verdi - cerimenin öyrənilməsi (17 gün əvvəl)

Software Developer cavab verdi - cerimenin öyrənilməsi (19 gün əvvəl)

Software Developer cavab verdi - Kapital bank rekvizit payoneer (19 gün əvvəl)

Software Developer cavab verdi - Hər hansı kompyuter proqramının (EXE faylı) etibarlı olub olmaması yəni qanuni və ya saxta olduğunu necə bilmək olar ? (19 gün əvvəl)

txmn cavab verdi - Hərbi biletsiz, möhlətsiz iş (21 gün əvvəl)

Galaxy cavab verdi - X-də (Twitter) premium abunəliklə bağlı çətinlik (21 gün əvvəl)

Rsad Ncfli cavab verdi - Payonner 2024 ilə bağlı sual (27 gün əvvəl)

Software Developer cavab verdi - Payonner 2024 ilə bağlı sual (27 gün əvvəl)

Rsad Ncfli cavab verdi - Payonner 2024 ilə bağlı sual (27 gün əvvəl)

Software Developer - 615 xal

E. Hacı - 607 xal

Onar Alili - 526 xal

Dilsuz - 448 xal

Cabbarov Sübhan - 434 xal

Maqa - 346 xal

Ruslan Butdayev - 328 xal

Namiq Bəndəli - 297 xal

U.Tarlan - 244 xal

Meherremoff - 234 xal

Sistemə daxil olmuş 23229 sualdan 92%-dən çoxu cavablandırılmışdır.

Proyekt haqqında

E-Haci.net istehsalı. © 2010-2024