Jump to content

Recommended Posts

Three text boxes being initially populated by three variable strings.  I want the user to edit the strings and then get the 3 new values of the text boxes and POST them to a new .php script.

 

Can someone shed some light on what I need to do?

 

<FORM>
<center>
<input name="productIDCode" type="text" id="productIDCode" value="<?php echo "$productIDCode" ?>" size="32" /><br /><br />
<input name="prodDescription" type="text" id="prodDescription" value="<?php echo "$description" ?>" size="32" /><br /><br />
<input name="prodAssesment" type="text" id="prodAssesment" value="<?php echo "$assesmentLimit" ?>" size="32" />

<?PHP

if (!isset($_POST['prodDescription']))
{
	$prodDescription2 = $_POST['prodDescription'];
	print ($prodDescription2);
}
else
{
	$prodDescription2 = 0;
}
?>

<br /><br />

<?php    
echo "<INPUT TYPE=\"BUTTON\" VALUE=\"Save\" ONCLICK=\"window.location.href='saveEdit.php?prID=$prodDescription2'\">"
?>    
</FORM>

Link to comment
https://forums.phpfreaks.com/topic/147139-solved-why-will-this-not-pass-as-a-post/
Share on other sites

#1

 

don't do

 

echo "$varname"

 

#2

 

I don't think you need to terminate single line php things but..

 

I usually do.. try

 

<?php echo $varname; ?>

 

I do not see if you'er even setting $varname

 

but if you arn't that would be your problem as I'm assuming php isn't spitting out parse errors and double quotes WILL evaluate a variable..

ok so now i have:

 

<FORM>
<center>
<input name="productIDCode" type="text" id="productIDCode" value="<?php echo "$productIDCode" ?>" size="32" /><br /><br />
<input name="prodDescription" type="text" id="prodDescription" value="<?php echo "$description" ?>" size="32" /><br /><br />
<input name="prodAssesment" type="text" id="prodAssesment" value="<?php echo "$assesmentLimit" ?>" size="32" />
<?php

$prodDescription = 'prodDescription';

?>

<br /><br />

<?php    
echo "<INPUT TYPE=\"BUTTON\" VALUE=\"Save\" ONCLICK=\"window.location.href='saveEdit.php?prID=$prodDescription'\">"
?>    
</FORM>

 

How do I get it to pass the value of the text box?

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.