Using a HTML button

From: Date: Fri, 11 Jan 2002 21:47:02 +0000
Subject: Using a HTML button
Groups: php.general 
Request: Send a blank email to php-general+get-80237@lists.php.net to get a copy of this message
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

« previous php.general (#80237) next »