Re: PHP inside Javascript
| From: | Ron Newman | Date: | Tue, 12 Sep 2000 18:16:02 +0000 |
| Subject: | Re: PHP inside Javascript | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16412@lists.php.net to get a copy of this message | ||
At 11:46 PM 9/11/00 -0700,
>Lars Torben writes:
>You can preset a form <input> by printing a variable into its value
>attribute:
>
> <form action="<?php echo $PHP_SELF ?>" method="post">
> <input type="text" name="username" value="<?php echo
> $username ?>">
> <!-- For a <textarea>, you'd do it like this: -->
> <textarea name="foo">
> <?php echo $foo ?>
> </textarea>
> <input type="submit">
> </form>
>
>
>You'll probably want to trim() the $foo from that last one, actually...:)
>But that shows the basic idea...
Yes, of course, thanks, I remembered that as I woke up this morning. But
there's another wrinkle: After the input has been verified and some
subsequent processing, the data has to be POSTed to a third-party credit
verification site, without user intervention.
I'm using <BODY onload=formSubmit()> to call a Javascript function,
formSubmit(), to do this. The Javascript function just does a submit_form().
Unless I can, invisible to the user, submit a form using PHP, I'm back to
Javascript, and since I'd have to require Javascript be turned on anyway, I
might as well use it for input verification (except for issues of security,
running on the browser rather than as a server script).
Hope I'm not being dense.
*************************************************
Ron Newman
Troubadour Technology
http://www.imt.net/~ronman/
*************************************************