zed420 Posted December 2, 2008 Share Posted December 2, 2008 Hi All Can someone point me in right direction please. I'm trying to send data from one page to another by using Checkboxes. First why doesn't header take the id and news to newsDisplay.php page even thou by clicking display button the page comes up but WITHOUT the id and news rows. The second code works but I have to make TWO attempts, I check the checkbox and click nothing happens but when I do the same again it works and does produces right result. ??? ??? if($_POST['display']) { foreach($_POST as $id) { //header('location: newsDisplay2.php?id=$id&news=$news'); echo "<form action=\"newsDisplay2.php?id=$id&news=$news\" method=\"POST\">"; } } Thanks in advance Zed Quote Link to comment https://forums.phpfreaks.com/topic/135096-need-help-with-code/ Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 try changing foreach($_POST as $id) { to foreach($_POST['display'] as $id) { Quote Link to comment https://forums.phpfreaks.com/topic/135096-need-help-with-code/#findComment-703686 Share on other sites More sharing options...
zed420 Posted December 2, 2008 Author Share Posted December 2, 2008 Thanks for the reply but I'm getting this error message; Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\t_line_ph\newsDetail2.php on line 12 Thanks Zed Quote Link to comment https://forums.phpfreaks.com/topic/135096-need-help-with-code/#findComment-704069 Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 Show us the form Quote Link to comment https://forums.phpfreaks.com/topic/135096-need-help-with-code/#findComment-704157 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.