473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Call function from a <form>

5
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..

<?php
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">";
</form>
?>

<?php
function test(){
echo $tekst;
}
?>


Regards Jeni
Aug 14 '06 #1
1 2632
Banfa
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

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

Similar topics

2
by: Ricki Susic | last post by:
Hi, Can anyone tell me if it is possible to call a function from a html form, where the function is included in the same file as the form. <html> <body> <form method="post" action="what...
4
by: Sims | last post by:
Hi, This will validate, (http://validator.w3.org/) <form method="POST" action="" name='xForm' style='background:inherit;'> <table style='background:inherit; width:100%;'> <tr width=80%> <td>...
6
by: Michael Hamm | last post by:
Hi, I'm trying to write a <form> whihc will retrieve a Web page on another server. I have (essentially) this: <form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi"> <input...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
3
by: Don | last post by:
Hi all, Is there some way in a <form> tag to transfer control to a JavaScript function after completion of the submit, where the <form> and function are on the same page? I believe ONSUBMIT and...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
10
by: Phlip | last post by:
HTMListas: (Apologies for I can't Google for this - too many common words.) I have a <form> tag. It thinks I want a <p> break before and after the form. I don't. (My forms are sneaky and...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.