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
1<?php
2 
3$valid_formats = array("jpg", "png", "gif", "zip", "bmp"); //icaze verilmis farmatlar
4$max_file_size = 1024*100; //100 kb
5$path = "uploads/"; // Upload qovluq
6$count = 0;
7 
8if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){
9    // Loop $_FILES to execute all files
10    foreach ($_FILES['files']['name'] as $f => $name) {    
11        if ($_FILES['files']['error'][$f] == 4) {
12            continue; // Skip file if any error found
13        }         
14        if ($_FILES['files']['error'][$f] == 0) {             
15            if ($_FILES['files']['size'][$f] > $max_file_size) {
16                $message[] = "$name is too large!.";
17                continue; // Skip large files
18            }
19            elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){
20                $message[] = "$name is not a valid format";
21                continue; // Skip invalid file formats
22            }
23            else{ // No error found! Move uploaded files
24                if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$name)) {
25                    $count++; // Number of successfully uploaded files
26                }
27            }
28        }
29    }
30}
31?>
32 
33<!doctype html>
34<html lang="en">
35<head>
36    <meta charset="UTF-8" />
37    <title>Multiple File Upload with PHP - Demo</title>
38<style type="text/css">
39a{ text-decoration: none; color: #333}
40h1{ font-size: 1.9em; margin: 10px 0}
41p{ margin: 8px 0}
42*{
43    margin: 0;
44    padding: 0;
45    box-sizing: border-box;
46    -webkit-box-sizing: border-box;
47    -moz-box-sizing: border-box;
48    -webkit-font-smoothing: antialiased;
49    -moz-font-smoothing: antialiased;
50    -o-font-smoothing: antialiased;
51    font-smoothing: antialiased;
52    text-rendering: optimizeLegibility;
53}
54body{
55    font: 12px Arial,Tahoma,Helvetica,FreeSans,sans-serif;
56    text-transform: inherit;
57    color: #333;
58    background: #e7edee;
59    width: 100%;
60    line-height: 18px;
61}
62.wrap{
63    width: 500px;
64    margin: 15px auto;
65    padding: 20px 25px;
66    background: white;
67    border: 2px solid #DBDBDB;
68    -webkit-border-radius: 5px;
69    -moz-border-radius: 5px;
70    border-radius: 5px;
71    overflow: hidden;
72    text-align: center;
73}
74.status{
75    /*display: none;*/
76    padding: 8px 35px 8px 14px;
77    margin: 20px 0;
78    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
79    color: #468847;
80    background-color: #dff0d8;
81    border-color: #d6e9c6;
82    -webkit-border-radius: 4px;
83    -moz-border-radius: 4px;
84    border-radius: 4px;
85}
86input[type="submit"] {
87    cursor:pointer;
88    width:100%;
89    border:none;
90    background:#991D57;
91    background-image:linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
92    background-image:-moz-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
93    background-image:-webkit-linear-gradient(bottom, #8C1C50 0%, #991D57 52%);
94    color:#FFF;
95    font-weight: bold;
96    margin: 20px 0;
97    padding: 10px;
98    border-radius:5px;
99}
100input[type="submit"]:hover {
101    background-image:linear-gradient(bottom, #9C215A 0%, #A82767 52%);
102    background-image:-moz-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
103    background-image:-webkit-linear-gradient(bottom, #9C215A 0%, #A82767 52%);
104    -webkit-transition:background 0.3s ease-in-out;
105    -moz-transition:background 0.3s ease-in-out;
106    transition:background-color 0.3s ease-in-out;
107}
108input[type="submit"]:active {
109    box-shadow:inset 0 1px 3px rgba(0,0,0,0.5);
110}
111</style>
112 
113</head>
114<body>
115    <div class="wrap">
116        <h1><a href="http://www.w3bees.com/2013/02/multiple-file-upload-with-php.html">Multiple File Upload with PHP</a></h1>
117        <?php
118        # error messages
119        if (isset($message)) {
120            foreach ($message as $msg) {
121                printf("<p class='status'>%s</p></ br>\n", $msg);
122            }
123        }
124        # success message
125        if($count !=0){
126            printf("<p class='status'>%d files added successfully!</p>\n", $count);
127        }
128        ?>
129        <p>Max file size 100kb, Valid formats jpg, png, gif</p>
130        <br />
131        <br />
132        <!-- Multiple file upload html form-->
133        <form action="" method="post" enctype="multipart/form-data">
134            <input type="file" name="files[]" multiple="multiple" accept="image/*">
135            <input type="submit" value="Upload">
136        </form>
137</div>
138</body>
139</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

E. Hacı cavab verdi - Elektron servis xidmətləri (6 gün əvvəl)

cavaninsan cavab verdi - Amerika səhmləri (15 gün əvvəl)

Software Developer cavab verdi - Amerika səhmləri (15 gün əvvəl)

SN cavab verdi - Kripto vergi (24 gün əvvəl)

Nicat97 cavab verdi - ilkaddimlar.com-a nə oldu? (31 gün əvvəl)

nicatmemmedli cavab verdi - Proqramlaşdırma - fəlsəfə (35 gün əvvəl)

nicatmemmedli cavab verdi - ilkaddimlar.com-a nə oldu? (35 gün əvvəl)

Software Developer cavab verdi - ilkaddimlar.com-a nə oldu? (45 gün əvvəl)

E. Hacı cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (54 gün əvvəl)

Triste cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (56 gün əvvəl)

E. Hacı cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (56 gün əvvəl)

Triste cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (56 gün əvvəl)

E. Hacı cavab verdi - Telefon almışam kamerasında ləkə var qaytarmaq istəyirəm, mağaza qaytarmır (56 gün əvvəl)

Software Developer cavab verdi - Rus dili yatırımı (57 gün əvvəl)

Cənab cavab verdi - Rus dili yatırımı (57 gün əvvəl)

Software Developer - 615 xal

E. Hacı - 608 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ş 23309 sualdan 92%-dən çoxu cavablandırılmışdır.

Proyekt haqqında

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