Help needed with code

Discussion in 'PHP' started by zed420, Dec 2, 2008.

  1. #1
    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. :confused:

     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\">"; 
    }
    }
    Code (markup):
    Thanks in advance
    Zed
     
    zed420, Dec 2, 2008 IP
  2. Christian Little

    Christian Little Peon

    Messages:
    1,753
    Likes Received:
    80
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Post the entire code, not just that snippet. Your asking about a checkbox, but there is no checkbox in that code.
     
    Christian Little, Dec 2, 2008 IP
  3. Mr.Shan0

    Mr.Shan0 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    variable will work only with double commas ""

    use this header
    header("Location: newsDisplay2.php?id=$id&news=$news");

    or
    header("Location: newsDisplay2.php?id=".$id."&news=".$news);
     
    Mr.Shan0, Dec 3, 2008 IP