porta325 Posted April 10, 2008 Share Posted April 10, 2008 Hey guys, i was wondering, if i generate let's say 10 values with a while loop how do i post each value separate to use in another file ? Link to comment https://forums.phpfreaks.com/topic/100483-post-values-from-while-loop/ Share on other sites More sharing options...
paul2463 Posted April 10, 2008 Share Posted April 10, 2008 during the while loop add each part to an array and then serialize the array and POST it Link to comment https://forums.phpfreaks.com/topic/100483-post-values-from-while-loop/#findComment-513851 Share on other sites More sharing options...
porta325 Posted April 10, 2008 Author Share Posted April 10, 2008 My favourite part of php, arrays ...Thx, i'll give it a try.Just thought it was possible other way. Link to comment https://forums.phpfreaks.com/topic/100483-post-values-from-while-loop/#findComment-513855 Share on other sites More sharing options...
porta325 Posted April 10, 2008 Author Share Posted April 10, 2008 Need more help on this one. The values echo great inside the while loop. But outside i only get the last value? How should i do to keep all the values from inside while loop to use them outside the loop ? Link to comment https://forums.phpfreaks.com/topic/100483-post-values-from-while-loop/#findComment-513881 Share on other sites More sharing options...
paul2463 Posted April 10, 2008 Share Posted April 10, 2008 if you can echo them inside the while loop then you should be able to store them in an array $postArray = array(); while (there are still things to do) { $postArray[] = variable; } print_r($postArray); // will print out all members of the new array Link to comment https://forums.phpfreaks.com/topic/100483-post-values-from-while-loop/#findComment-513983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.