NoPHPPhD Posted February 1, 2009 Share Posted February 1, 2009 Very very basic. Trying to get this to where I can enter amounts in text boxes, click Enter, and the amounts are still there. Want to do totals and checking if numeric later, but cant get basic stuff to work. <?php session_start(); ?> <form method="post" action="<?php echo $PHP_SELF; ?>"> <?php if (isset($_POST['submit'])) { $_SESSION['3_c1_bx1'] = $_POST['3_c1_bx1']; $_SESSION['3_c1_bx2'] = $_POST['3_c1_bx2']; $_SESSION['4_c1_bx1'] = $_POST['4_c1_bx1']; $_SESSION['4_c1_bx2'] = $_POST['4_c1_bx2']; $_SESSION['5_c1_bx1'] = $_POST['5_c1_bx1']; $_SESSION['5_c1_bx2'] = $_POST['5_c1_bx2']; $_SESSION['total_bx1'] = $_POST['total_bx1']; $_SESSION['total_bx2'] = $_POST['total_bx2']; } ?> <input type="submit" name = "submit" value="Enter" /> <table class="means" cellpadding="1"> <tr> <td>Gross wages:</td> <td><input type="text" size="5" maxlength="9" name="3_c1_bx1" value="<?php $_SESSION['3_c1_bx1']; ?>"/></td> <td><input type="text" size="5" maxlength="9" name="3_c1_bx2"/></td> </tr> <tr> <td>Gross salary:</td> <td><input type="text" size="5" maxlength="9" name="4_c1_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="4_c1_bx2"/></td> </tr> <tr> <td>Gross tips:</td> <td><input type="text" size="5" maxlength="9" name="5_c1_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="5_c1_bx2"/></td> </tr> <tr> <td>Total:</td> <td><input type="text" size="5" maxlength="9" name="total_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="total_bx2"/></td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/143329-solved-why-does-this-not-work-text-box-values-and-session/ Share on other sites More sharing options...
ultrus Posted February 1, 2009 Share Posted February 1, 2009 I've run into this before, small problem. Huge headache. Add echo in front of your form value. ... <input type="text" size="5" maxlength="9" name="3_c1_bx1" value="<?php echo $_SESSION['3_c1_bx1']; ?>"/> ... Link to comment https://forums.phpfreaks.com/topic/143329-solved-why-does-this-not-work-text-box-values-and-session/#findComment-751741 Share on other sites More sharing options...
NoPHPPhD Posted February 1, 2009 Author Share Posted February 1, 2009 OMG. Glad someone spoke up before i formatted. thanks!!! Link to comment https://forums.phpfreaks.com/topic/143329-solved-why-does-this-not-work-text-box-values-and-session/#findComment-751749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.