darksniperx Posted November 28, 2007 Share Posted November 28, 2007 if($_POST['submit']) { /*comment code temporarely foreach($_POST['name'] as $value) { echo $value; } */ $name = $_POST['name']; $email = $_POST['email']; $website = $_POST['website']; for($posion = 0; $position < count($name); $position ++) { echo $name[$position] . " : - : " . $email[$position] . " : - : " .$website[$position] ."\n"; } } when I use for each everything works and I get output, the problem, it works only with one variable. Since I have to work with 3 variables arrays I have switched to for look, but I get no output??? Link to comment https://forums.phpfreaks.com/topic/79332-solved-switching-from-foreach-to-for-error/ Share on other sites More sharing options...
Wes1890 Posted November 28, 2007 Share Posted November 28, 2007 Check your spelling for($posion = 0; $position < count($name); $position ++) change it to: for($position = 0; $position < count($name); $position ++) Link to comment https://forums.phpfreaks.com/topic/79332-solved-switching-from-foreach-to-for-error/#findComment-401582 Share on other sites More sharing options...
darksniperx Posted November 28, 2007 Author Share Posted November 28, 2007 thx, I should have found it myself. Link to comment https://forums.phpfreaks.com/topic/79332-solved-switching-from-foreach-to-for-error/#findComment-401593 Share on other sites More sharing options...
Wes1890 Posted November 28, 2007 Share Posted November 28, 2007 No problem man, come back if you need anything else Link to comment https://forums.phpfreaks.com/topic/79332-solved-switching-from-foreach-to-for-error/#findComment-401595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.