/    Sign up×
Community /Pin to ProfileBookmark

PHP script executed by clicking button

Hi,

Simple question!

I’m learning PHP from a book, while building a site at the same time. In it, it shows that the script aaa.php can be ran by clicking on a button inside a form that has the tag

<form action=”aaa.php” method=post>

I have 2 files aaa.php and bbb.php that are to be ran under different circumstances. I’m thinking of having 2 buttons labelled aaa and bbb, which when clicked would ran the 2 scripts. I’ve done some google, and the examples provided are for javascript. Anyone knows how this is done for PHP!

Thanks!

DL

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@felgallJan 04.2007 — <form action="aaa.php" method=post>

<input type="submit" value="Submit aaa.php">

</form>

<form action="bbb.php" method=post>

<input type="submit" value="Submit bbb.php">

</form>
×

Success!

Help @dataline spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...