Home > Archive > PHP Language > September 2006 > write a text by clicking the button
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
write a text by clicking the button
|
|
| SAN CAZIANO 2006-09-06, 7:56 am |
| Mai I have an example of code to do this:
I want some button that when they was clicked by the user, php reload the
page and change a text variable
for example: I click the button 1, and the text write ONE
| |
| Flamer 2006-09-07, 3:57 am |
|
SAN CAZIANO wrote:
> Mai I have an example of code to do this:
> I want some button that when they was clicked by the user, php reload the
> page and change a text variable
> for example: I click the button 1, and the text write ONE
try this:
if (isset ($_POST['submit'])) { $button = "has been pressed";} else {
$button = "has not been pressed"; }
then:
echo $button;
stick that php into the document witht he form and make sure the form
action is set to the same page and method is post.
Flamer.
|
|
|
|
|