calling a function in html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tvs008
Forum Commoner
Posts: 29
Joined: Wed May 03, 2006 10:46 pm
Location: Seattle

calling a function in html

Post 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
tengue17
Forum Newbie
Posts: 8
Joined: Tue Jul 11, 2006 1:16 am

i would also like to know how

Post 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?
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: i would also like to know how

Post 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.
Post Reply