|
Posted by Utopar on 12/22/07 15:34
On Dec 21, 6:49 pm, Carla Fong <carla.xspamx.f...@verizon.net> wrote:
> Hello - I'm trying to learn HTML and PHP and have hit a wall with some
> odd behavior I can't fathom. I'm pretty good with C and this just seems
> strange.
>
> <form method=POST action="<?php TestPhp();?>">
> <tr>
> <td> Input Prompt:</td> <td> <input type=text name="Line_1"
> value = "<?php echo $_Line1; ?>" maxlength=24
> </td></tr><BR>
>
When you first display the Form, and specify action= you drop into PHP
and actually call the TestPhp() function. The function runs at that
time and updates your value =After Function.
Instead, your POST action should call the original script. You already
have a way to detect that form data is present, so within that test
call the TestPhp() function to updated the value.
<?php
// a debug statement that shows $_POST is empty prior to form action
if (empty ($_POST)) echo "POST data is empty";
else TestPhp();
?>
Navigation:
[Reply to this message]
|