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 ??? Link to comment https://forums.phpfreaks.com/topic/49162-problem-with-input-typetext-in-form-methodpost/ 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" Link to comment https://forums.phpfreaks.com/topic/49162-problem-with-input-typetext-in-form-methodpost/#findComment-240929 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. Link to comment https://forums.phpfreaks.com/topic/49162-problem-with-input-typetext-in-form-methodpost/#findComment-240940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.