Navajo Posted February 27, 2009 Share Posted February 27, 2009 Three text boxes being initially populated by three variable strings. I want the user to edit the strings and then get the 3 new values of the text boxes and POST them to a new .php script. Can someone shed some light on what I need to do? <FORM> <center> <input name="productIDCode" type="text" id="productIDCode" value="<?php echo "$productIDCode" ?>" size="32" /><br /><br /> <input name="prodDescription" type="text" id="prodDescription" value="<?php echo "$description" ?>" size="32" /><br /><br /> <input name="prodAssesment" type="text" id="prodAssesment" value="<?php echo "$assesmentLimit" ?>" size="32" /> <?PHP if (!isset($_POST['prodDescription'])) { $prodDescription2 = $_POST['prodDescription']; print ($prodDescription2); } else { $prodDescription2 = 0; } ?> <br /><br /> <?php echo "<INPUT TYPE=\"BUTTON\" VALUE=\"Save\" ONCLICK=\"window.location.href='saveEdit.php?prID=$prodDescription2'\">" ?> </FORM> Link to comment https://forums.phpfreaks.com/topic/147139-solved-why-will-this-not-pass-as-a-post/ Share on other sites More sharing options...
RussellReal Posted February 27, 2009 Share Posted February 27, 2009 #1 don't do echo "$varname" #2 I don't think you need to terminate single line php things but.. I usually do.. try <?php echo $varname; ?> I do not see if you'er even setting $varname but if you arn't that would be your problem as I'm assuming php isn't spitting out parse errors and double quotes WILL evaluate a variable.. Link to comment https://forums.phpfreaks.com/topic/147139-solved-why-will-this-not-pass-as-a-post/#findComment-772442 Share on other sites More sharing options...
Navajo Posted February 27, 2009 Author Share Posted February 27, 2009 ok so now i have: <FORM> <center> <input name="productIDCode" type="text" id="productIDCode" value="<?php echo "$productIDCode" ?>" size="32" /><br /><br /> <input name="prodDescription" type="text" id="prodDescription" value="<?php echo "$description" ?>" size="32" /><br /><br /> <input name="prodAssesment" type="text" id="prodAssesment" value="<?php echo "$assesmentLimit" ?>" size="32" /> <?php $prodDescription = 'prodDescription'; ?> <br /><br /> <?php echo "<INPUT TYPE=\"BUTTON\" VALUE=\"Save\" ONCLICK=\"window.location.href='saveEdit.php?prID=$prodDescription'\">" ?> </FORM> How do I get it to pass the value of the text box? Link to comment https://forums.phpfreaks.com/topic/147139-solved-why-will-this-not-pass-as-a-post/#findComment-772450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.