471,086 Members | 1,197 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,086 software developers and data experts.

Call function from a <form>

Can anyone tell me if it is possible to call a function from a php form (which use html),
where the function is included in a class in another php file..

echo "<pre><form method=\"post\" action=\="what do I write here to acces function test()">";

echo "<input type="text" name="tekst">";
echo"<input type="submit" value="send">";

function test(){
echo $tekst;

Regards Jeni
Aug 14 '06 #1
1 2496
9,065 Expert Mod 8TB
This is not possible in the way you describe, all php code runs server side but the form runs client side.

You have to provide a link to a new php script (or the same one) and as the server serves the script it is run with any data from the form.
Aug 14 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ricki Susic | last post: by
6 posts views Thread by Michael Hamm | last post: by
10 posts views Thread by Phlip | last post: by
6 posts views Thread by snacktime | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.