|  | Posted by Olaf Schinkel on 12/23/07 23:33 
Utopar schrieb:> On Dec 22, 12:38 pm, Carla Fong <carla.xspamx.f...@verizon.net> wrote:
 >> Utopar wrote:
 >>> 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();
 >>> ?>
 >> Ah, I think I see....
 >>
 >> So, when I put that <?php TestPhp();?> inside the action= quotes, I'm
 >> not calling the function as a result of the action click, we're just
 >> inserting whatever text that function returns into the 'action'
 >> parameter at the time the 'action' item is first parsed - is that right?
 
 When you make this:
 action="<?PHP bla();?>" and function bla returns 5 so the result is :
 action="5"
 
 See:
 PHP is a server language, NOT a client language.
  Navigation: [Reply to this message] |