Page 1 of 1

calling a function in html

Posted: Tue Jul 11, 2006 1:49 am
by tvs008
hi

How do I call a php function within an html page? Any mention of the function executes it, but I only want it to execut on submit, yet stay on the same page, or even better, refresh the page I'm on.

For example, I have

Code: Select all

<form action="<?php clearReport(); ?>" >
but this executes the code as soon as it reads this line.

Basically, its for updating and refreshing the form on the same page.

-t

i would also like to know how

Posted: Tue Jul 11, 2006 2:38 am
by tengue17
so far i used javascript to preprocess the form before submitting. but javascript is very unfamiliar to me. if using php is possible, i would also like to know how.
but as php runs in the server side, doesnt it means that we have to submit it to the server first?

Re: i would also like to know how

Posted: Tue Jul 11, 2006 3:23 am
by jmut
tengue17 wrote:so far i used javascript to preprocess the form before submitting. but javascript is very unfamiliar to me. if using php is possible, i would also like to know how.
but as php runs in the server side, doesnt it means that we have to submit it to the server first?
This is exactly what it means. The only way I can think of calling serverside script is using Axaj technique....namely, javascript to make a remote call to the server.