לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #13  
ישן 28-09-2006, 18:07
צלמית המשתמש של MatiM
  משתמש זכר MatiM MatiM אינו מחובר  
 
חבר מתאריך: 12.04.06
הודעות: 2,021
שלח הודעה דרך MSN אל MatiM
בתגובה להודעה מספר 12 שנכתבה על ידי ישראל K שמתחילה ב "לא טעית, בדיוק לכך..."

תעזרו לנעזר - אני


בכל אופן,
עכשיו הבנתי מה רצית !
[פעם הבאה תן קוד, יחסוך את הבעיה חחחח]


בכל אופן,
יצא משהו ארוך מאוד [עם כל השדות שיש לי בטופס]

בבקשה:

קוד:
Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים ) Array ( [singer1] => singer_[1] [song_1] => song_1 [lastweek_1] => lastweek_1 [pic_1] => pic_1 [singer2] => singer_[2] [song_2] => song_2 [lastweek_2] => lastweek_2 [pic_2] => pic_2 [singer3] => singer_[3] [song_3] => song_3 [lastweek_3] => lastweek_3 [pic_3] => pic_3 [singer4] => singer_[4] [song_4] => song_4 [lastweek_4] => lastweek_4 [pic_4] => pic_4 [singer5] => singer_[5] [song_5] => song_5 [lastweek_5] => lastweek_5 [pic_5] => pic_5 [singer6] => singer_[6] [song_6] => song_6 [lastweek_6] => lastweek_6 [pic_6] => pic_6 [singer7] => singer_[7] [song_7] => song_7 [lastweek_7] => lastweek_7 [pic_7] => pic_7 [singer8] => singer_[8] [song_8] => song_8 [lastweek_8] => lastweek_8 [pic_8] => pic_8 [singer9] => singer_[9] [song_9] => song_9 [lastweek_9] => lastweek_9 [pic_9] => pic_9 [singer10] => singer_[10] [song_10] => song_10 [lastweek_10] => lastweek_10 [pic_10] => pic_10 [newdatabutt] => שמור נתונים )


וכל זה יצא מ:

קוד:
for ($i=1 ; $i<=10 ; $i++) { print_r ($_POST); echo "<BR>"; }


מקווה שתוכלו עכשיו לעזור לי

[ד"א, שמות כל השדות מורכבים כך: XXX_{$i} כאשר הXXX הוא שם השדה _ $i מסמל מספר בfor !]
_____________________________________
תמונה שהועלתה על ידי גולש באתר ולכן אין אנו יכולים לדעת מה היא מכילה

תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
  #14  
ישן 28-09-2006, 18:28
  ישראל K ישראל K אינו מחובר  
 
חבר מתאריך: 25.08.03
הודעות: 9,114
בתגובה להודעה מספר 13 שנכתבה על ידי MatiM שמתחילה ב "תעזרו לנעזר - אני ;) בכל..."

ראשית, הלולאה ממש מיותרת, בסך הכל נדרשת לקרוא פעם אחת לפונקציה print_r (להבא...)
אגב, בכוונה התעקשתי לו להציג לך קוד, תשים בל להבא לקרוא מה שכתוב בהודעה...

ולעניינינו (או "לעזרתנו" - כנדרש מהמשך השרשור )
אם יש בעיה היא מתחילה בדרך שבה אתה מדפיס את הטופס (לדפדפן) ולא בדרך שאתה מנסה לטפל בנתוני הטופס. אבל כרגע נתמודד עם המצב הנתון.
היות ושמות השדות מורכבים מ"שם+id" ולעתים "שם+_+id" כל מה שנדרש הוא לשרשר את השם + ה-id (או בתוספת הקו תחתי אם יש).

דוגמה:
קוד PHP:
 echo $_POST['singer'.$i];
echo 
$_POST['song_'.$i]; 

תשים לב שכלל לא מדובר במערך אלא באיבר סקלרי (פשוט - לא סוג מורכב כמו מערך, אובייקט או אחר).
אם רצונך שהאיבר song יהיה מערך תצטרך ששמו בשדה הקלט יהיה כפי הדוגמה הבאה:
קוד:
<input type="text" id="song1" name="song[1]" />
תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 22:22

הדף נוצר ב 0.17 שניות עם 10 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2024 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר