Click to See Complete Forum and Search --> : Passing Values from Php back to HTML


jo3c
08-05-2009, 02:24 AM
so it's like this
2 files 1 is called orderform.html the other one is called processorder.php

orderform.html
<html>
<form action="processorder.php" method=post>
INPUT
<input type="text" name="input" size=50 maxlength=40 >
</form>
</html>


processorder.php
<? php>
$input = $_POST['input'];
echo 'Display'.$input.'</td>';

<form action="orderform.html" method="get" target="top"><input type="submit" value="Edit"></form>


Once it clicked Edit on processorder.php and it will go back to orderform.html with "input" already filled in

How do i do that?

ANY help will be deeply appreciated!

jo3c
08-05-2009, 02:42 AM
it's textfield autofield from the php file.

welsh
08-05-2009, 03:03 AM
On the processorder.php page you could do this:

<form action="orderform.html" method="post" target="top">
<input type="hidden" name="input" value="<?php echo $input; ?>">
<input type="submit" value="Edit">
</form>


Then on the orderform.html change it to orderform.php and change the textbox to:

<input type="text" name="input" size=50 maxlength=40 value="<?php echo $_POST['input']; ?>">

jo3c
08-05-2009, 04:46 AM
Thanks! Here is my complete working script
orderform.php -> input
processorder.php ->display & edit
once clicked edit
back to orderform.php with autofill


orderform.php
<?php
$input = $_POST['input'];

echo '<form action="processorder.php" method=post>';
echo '<input type="text" name="input" size=50 maxlength=40 value="';
echo $input;
echo '">';
echo '<input type="submit" value="Save">';
echo '</form>';

?>
Processorder.php
<?php
$input = $_POST['input'];
?>

<form action="orderform.php" method="post" target="top">
<input type="hidden" name="input" value="<?php echo $input; ?>">
<input type="submit" value="Edit">
</form>

jo3c
08-05-2009, 06:56 AM
by the way does anyone know how to do this with textarea?