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

 

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.