[PHP] Re: Using a HTML button

2002-01-11 Thread J Smith


PHP is a server-side language (i.e. Perl when used with mod_perl), not a 
client-side language (i.e. JavaScript). All of the processing is done on 
the server BEFORE it is sent to the user. Therefore, you can't call a PHP 
function directly from a web page after the user has received it, since all 
of the processing has already been done.

J


Morten Nielsen wrote:

 Hi,
 
 I am rather new to PHP so I hope somebody can help me.
 
 I have a normal button (HTML code). Then I have made a function
 
 function multiply($X)
 {
 return 2*$X;
 }
 
 The button has an OnClick, which calls my function.
 INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);?
 
 
 I then writes $X to the screen.
 
 ?php echo $X ?
 
 The problem is I dont even have to press the button. When the page loads
 it already has calculated 2*$X. Why is that. I would like to only call my
 function when I press my button.
 
 Please help
 Morten


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Using a HTML button

2002-01-11 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* On 11-01-02 at 22:57 
* J Smith said

 
 PHP is a server-side language (i.e. Perl when used with mod_perl), not a 
 client-side language (i.e. JavaScript). All of the processing is done on 
 the server BEFORE it is sent to the user. Therefore, you can't call a PHP 
 function directly from a web page after the user has received it, since all 
 of the processing has already been done.

Of course, I think in my case the expresion is 'barking up the wrong
tree'.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8P2CdHpvrrTa6L5oRAuYZAKCVRqP6XhhLIu4X2b8+xL8ctnG+SwCff+v2
As7/xKIhSyk2niDW1aLgA40=
=jQmN
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]