/    Sign up×
Community /Pin to ProfileBookmark

Calling function using button….

can anybody pls help me….
how can i call a PHP script or function by using button?
for example, i have this PHP script
<HTML>
<?
function func(){
$rv=”PHP Script”;
return $rv;

//button script here.
}
?>
</HTML>

what should i do next if I want the function ‘func’ to be called
by pressing button…by the way, the button script should reside inside the PHP script…

tnx! in advance!!!!

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@ray326Dec 28.2004 — PHP runs on the server but buttons "run" in the browser. You have to submit the page (make a request) to get PHP code to run.
Copy linkTweet thisAlerts:
@PeOfEoDec 28.2004 — [i]Originally posted by ray326 [/i]

[B]PHP runs on the server but buttons "run" in the browser. You have to submit the page (make a request) to get PHP code to run. [/B][/QUOTE]
Which means that the function is going to have to be called on page load because when the page is resent you are either going to be on a new page or the page you are on will be refreshing depending on the action.
×

Success!

Help @daimous 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.19,
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,
)...