Jump to content

Problem with "input type=text" in "form method="post""


gray_bale

Recommended Posts

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 ???

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.