/    Sign up×
Community /Pin to ProfileBookmark

How to run a PHP function?

Hi

How do I run a PHP function with the onClick function?

example: I want to run the following code, when I click a button:

<? PHP
function hello() {

echo (“hello”);}

?>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bokehAug 15.2006 — How do I run a PHP function with the onClick function?[/QUOTE]You don't! onclick is javascript not PHP, the biggest difference being PHP code is executed on the server before the document loads while Javascript is executed on the client at an instant prescribed by its logic.
×

Success!

Help @Dennis_Ingham 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 5.14,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...