Re: Re: [PHP3] Functions

From: Date: Tue, 30 May 2000 17:41:11 +0000
Subject: Re: Re: [PHP3] Functions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-650@lists.php.net to get a copy of this message
I find it useful for search type pages to set the form action to the name of the file ($PHP_SELF) and handle it something like <? function search ($searchword) { // php search/display code here } echo "<form action='$PHP_SELF' method=post>"; echo "<input type=text name=keyword>"; echo "<input type=submit name=submit_button>"; echo "</form>"; if ($submit_button) { search ($keyword); // get/print results } ?> hth ryan > Katrin Jonsson <kjonsson@informatik.umu.se> wrote in message > news:39339A5B.B3CE541B@informatik.umu.se... > > Hi, > > > > does anyone now if it´s possible to call a function in a html form? > > > > <form action="foo.php3" method="post"> > > in the action line you type in the file you want to be called, but > > instead i want to call a function placed in the same file > > I´ve tried something like this: > > <form action="search();" method="post"> > > but it doesn´t work because the action call search for a file as > > default. > > > > regards Katrin > >

« previous php.general (#650) next »