הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 18-04-08, 13:09   # 11
mayden
Авторитет
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 2,556

mayden לא מחובר  

בעיקרון תעשה משהו כזה:
PHP קוד:
 for($i 0$i sizeof($_FILES['uploadedfile']['name']); $i++) {
$type $_FILES['uploadedfile']['type'][$i];
$file $_FILES['uploadedfile']['name'][$i];
..
..

לולאה על סה"כ פעמים הקבצים שהועלו.
__________________

ציטוט:
" זוכרים בשביל ללמוד, יודעים בשביל ללמד, מבינים בשביל לתכנת.."
  Reply With Quote
ישן 18-04-08, 21:28   # 12
Labs
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Nov 2007
גיל: 34
הודעות: 1,500
Send a message via Skype™ to Labs

Labs לא מחובר  

אולי עשיתי משהו לא טוב בטופס
HTML קוד:
<form method="post" id="regf" action="myprofile.php?act=Gupload1">
<table width="100%"><tr><td colspan="2" class="regit">העלאת תמונות לגלריה</td></tr></table>
<table width="100%">
<tr><td style="width: 150px;" align="center">כתובת התמונה</td><td style="width: 150px;" align="center">כותרת התמונה</td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
<tr><td style="width: 150px;" align="center"><input type="file" name="pic[]" style="width: 150px;" /></td><td style="width: 150px;" align="center"><input type="text" name="t[]" style="width: 150px;" /></td></tr>
</table>
<table>
<tr><td width="100%" align="center"><input type="submit" name="submit" style="margin: 10px;" value="שלח" /></td></tr>
</table>
<table height="6"><tr height="6"><td height="6"></td></tr></table>
</form>

PHP קוד:
case "Gupload1":
$pic[]=$_POST['pic'];
$t[]=$_POST['t'];
$folder="gallery/".$usernamef;
    if (!(
is_dir($folder))){
    
mkdir("$folder");
}
// foreach ($pic as $k => $v) {
 
for($i 0$i sizeof($HTTP_POST_FILES['pic']['name']); $i++) {
$v=$pic[$i];
    if (
$v!="") {
if (!(
is_numeric($te))) {
$testt=$t['$k'];
$temysql_real_escape_string($testt);
}
//num id
$numid mysql_query("select * from `gpic`"); 
$numid mysql_num_rows($numid);
if (
$numid=="") {
$id=1;
} else {
$y=0;
for (
$ii=1;$ii<=$numid;$ii++) {
$nuum mysql_query("select * from `gpic` WHERE `id`= '$ii'"); 
$nuum mysql_num_rows($nuum);
if (
$nuum=="") {
$id=$ii;
$ii=999999999999;
$y=1;
}
}
if (
$y==0) {
$id=$numid+1;
}
}
// end num id

$file_name $HTTP_POST_FILES['pic']['name'][$i];
echo 
"$file_name";
echo 
"<br />";
$msiu=getlast($file_name);
$new_file_name=$id.$dottt.$msiu;
    
$path"gallery/".$usernamef."/".$new_file_name;
echo 
"$path";
echo 
"<br />";
for(
$i=0;$i<count($file_ext_allow);$i++)
        {
            if (
getlast($file_name)!=$file_ext_allow[$i])
                
$test.="~~";
        }
$exp=explode("~~",$test);
        if (
count($exp)!=(count($file_ext_allow)+1))
        {
if(
copy($HTTP_POST_FILES['pic']['tmp_name'], $path))
{
$rashi=1;
// סוף העלאת תמונות

$add "INSERT INTO gpic (id, user, last, ko) VALUES ('$id', '$usernamef', '$msiu', '$te')";
mysql_query($add);
} else {
echo 
"העלאת התמונה נכשלה <br />";
}
} else {
echo 
"סוג קובץ אסור <br />";
}

}

כל הקוד המלא
אני לא מצליח לתקן את זה בשום דרך יושב על זה כבר יום שני
__________________
אין יותר צהל!
Skype: lab5dan
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 20:04.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ