jigsawsoul Posted August 15, 2009 Share Posted August 15, 2009 $result = "SELECT * FROM wbl_craftsperson ORDER BY name ASC"; $result = mysql_query( $result ) or die( mysql_error() ); $craftsperson1 .= '<select name="craftsperson1" id="craftsperson1">'; while( $row = mysql_fetch_assoc( $result ) ) $craftsperson1 .= '<option value="'.$row['$craftsperson_id'].'">'.$row['name'].'</option>'; $craftsperson1 .= '</select>'; Then in the html <div id="form_accountinfo" class="mb"> <h1>Send Response</h1> <p class="grey">You are currently logged in as <em><?=$username?></em>.</p> <form action="respond2.php?id=<?=$commissionid?>" method="post"> <fieldset> <label for="subject"><b>Description</b></label> <?=$current_description?> <br /> <label for="subject"><b>Comments</b></label> <?=$current_comments?> <br /> <label for="craftsperson1"><b>Crafts Person 1</b></label> <?=$craftsperson1?> <label for="quote1"><b>Quote 1</b></label> <input id="quote1" name="quote1" size="30" type="text" value="£" /><br /> <label for="craftsperson2"><b>Crafts Person 2</b></label> <?=$craftsperson2?> <label for="quote2"><b>Quote 2</b></label> <input id="quote2" name="quote2" size="30" type="text" value="£" /><br /> <input type="submit" value="Send Response" class="primary" /> </fieldset> </form> Page 2 $craftsperson1 = $_POST['craftsperson1']; echo $craftsperson1; exit; But i get nothing i have checked all the names on my pages and database but everything to be seems fine.. ? Quote Link to comment https://forums.phpfreaks.com/topic/170422-solved-post-from-a-drop-down-box-not-working-help-me-please/ Share on other sites More sharing options...
ignace Posted August 15, 2009 Share Posted August 15, 2009 $row['$craftsperson_id'] should be: $row['craftsperson_id'] Quote Link to comment https://forums.phpfreaks.com/topic/170422-solved-post-from-a-drop-down-box-not-working-help-me-please/#findComment-898986 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.