Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Fehlermeldung : Invalid argument supplied for foreach()

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Mon Nov 29, 2004 11:22 am    Post subject: Fehlermeldung : Invalid argument supplied for foreach() Reply with quote

Folgende Fehlermeldung wird auf der index.php ausgegeben !

Ausgabe index.php :
Code:
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/srv/www/htdocs/web78/html/demo/index.php</b> on line <b>49</b><br />


Quell-Code-index.php :
Code:
$dateienname=array();
foreach($datei_name as $himbeere)
{
array_push($dateienname,$himbeere);
}


Weiss einer wo der Fehler liegt ?

________
grilling steaks

Last edited by halloweb on Wed Feb 02, 2011 7:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Mon Nov 29, 2004 12:27 pm    Post subject: Reply with quote

überprüf mal, was in $datei_name drinnsteht
(echo $datei_name[0], $datei_name[1], ...)

was genau willst du machen, dann kann ich dir mehr sagen Wink

sonst kuckst du hier
foreach: http://selfphp.info/funktionsreferenz/kontroll_mechanismen/foreach.php
arrays: http://selfphp.info/funktionsreferenz/array_funktionen/index.php
array-push: http://selfphp.info/funktionsreferenz/array_funktionen/array_push.php

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Mon Nov 29, 2004 3:42 pm    Post subject: Reply with quote

Quote:
was genau willst du machen, dann kann ich dir mehr sagen


Es wird damit ein Filename ausgegeben !

index.php:
Code:
$dateienname=array();
foreach($datei_name as $himbeere)
{
array_push($dateienname,$himbeere);
}


index.tpl :
Code:
...colspan=2><input type=file name=datei[]>
...colspan=2><input type=file name=datei[]>
...colspan=2><input type=file name=datei[]>


Was das Script auch macht !

Nur bekomme ich folgende Fehlermeldung in der index.php

Code:
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/srv/www/htdocs/web78/html/demo/index.php</b> on line <b>8</b><br />


"Invalid argument supplied for foreach()"

Wie soll ich "foreach()" ausgeben ?

Quote:
sonst kuckst du hier
foreach: http://selfphp.info/funktionsreferenz/kontroll_mechanismen/foreach.php
arrays: http://selfphp.info/funktionsreferenz/array_funktionen/index.php
array-push: http://selfphp.info/funktionsreferenz/array_funktionen/array_push.php


Danke, die Seiten sind sehr hilfreich !

________
vapir air one

Last edited by halloweb on Wed Feb 02, 2011 7:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Nov 29, 2004 3:52 pm    Post subject: Reply with quote

$dateienname != $datei_name

(setz mal dein error-reporting auf E_ALL, dann wirs du evtl. eine E_NOTICE bekommen, dass $datei_name undefined ist)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Mon Nov 29, 2004 5:00 pm    Post subject: Reply with quote

Danke Messju,

Code:
$dateienname != $datei_name


Das war der Fehler Rolling Eyes

________
starcraft 2 replays
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP