Results 1 to 2 of 2

Thread: Get POST info problem

Threaded View

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Resolved Get POST info problem

    I'm creating a poll script with up to 10 available answers. I'm using the below code to check answers and add them into my mySQL database however all the POST "answers" are returning blanks when they shouldn't. Can someone help me out?

    PHP Code:
    //This is my current code
    for($i=1;$i<11;$i++) {

    if (
    $_POST['answer$i'] != "") {
    $answer $_POST['answer$i'];
    $add_answer mysql_query("INSERT into answers VALUES('$id', '$answer, '0')"$db);

    PHP Code:
    //If I use this is picks up the POST "answer" value
    $answer $_POST['answer1'];

    //but this doesn't
    $i="1";
    $answer $_POST['answer$i']; 
    Last edited by lintz; Jan 19th, 2005 at 06:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width