Any idea why this isn't posting?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brendanmcdonagh
    New Member
    • Nov 2007
    • 153

    Any idea why this isn't posting?

    Code:
    <form name="<?php echo $namex?>" action="insert.php" method="POST">                               
     <input type="submit" name="<?php echo $namex?>"
             value="Update"/> 
            </form>              <?php        echo "</tr>\n";    }    ?>
    I know it's not pretty but im just trying to get it working,
    i have a list of names, location, time/date (all from mysql db) and then an update button next to each person record. Now before I can even think how im going to determine which update button was clicked, i want the above just to get "talking" to the following...

    Code:
    <div align="right"><?php
    $namex = $_POST['Chris Britain'];
    echo $namex;
    ?> </div>
    I'm just not getting any output from the last snippet of code.

    Anyone see why?
  • iamgame
    New Member
    • Sep 2008
    • 4

    #2
    I think you need to do these in order to get it working:

    1. End the sole PHP statement in your form code with a semi-colon. That is, change <?php echo $namex?> to <?php echo $namex;?>
    2. You have used $_POST['Chris Britain'], which means there is an element, probably an input tag, in your form whose "name" attribute has the value "Chris Britain". You cannot use spaces to specify names. You should choose a name like Chris_Britain or Chris-Britain, etc. You get the idea.

    I hope this info helps you troubleshoot this problem.

    Comment

    Working...