gray_bale Posted April 29, 2007 Share Posted April 29, 2007 I have a problem, and below is the code extracts that have the problem with. But the full code is located at http://www.gb-online.co.uk/services/shed.php I have included an echo statement at the top right, just to check that the data is being recieved OK. The general problem is that I cannot get the form to remember what is typed into the "name=pres" all the other data fields remember what is typed in. The actual code snippet is the same in all cases if ((isset($_POST['done'])) && ($_POST['done'] == 'y')) { $pres = $_POST["pres"]; <form method="post" action="<?php echo $PHP_SELF;?>"> Preservative to be included in price (Y or N)- <input type=text name=pres value="<?echo $pres?>" size="10"> Any ideas as its bound to simple ??? Quote Link to comment Share on other sites More sharing options...
JJohnsenDK Posted April 29, 2007 Share Posted April 29, 2007 try putting the type and name in quotes... type="text" name="pres" Quote Link to comment Share on other sites More sharing options...
BRUm Posted April 29, 2007 Share Posted April 29, 2007 The global variable is wrong. Change: <form method="post" action="<?php echo $PHP_SELF;?>"> To: <form method="POST" action="<? $_SERVER['PHP_SELF']; ?>"> So, I would totally re-do with: IF ((isset($_POST['done'])) && ($_POST['done'] == 'y')) { $pres = $_POST['pres']; <form method='POST' action='<? $_SERVER['PHP_SELF']; ?>'> Preservative to be included in price (Y or N)- <input type='text' name='pres' value='<? print $pres; ?>' size='10'> Lee. Quote Link to comment 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.