Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit by text link 1

Status
Not open for further replies.

hz

Programmer
Oct 2, 2000
29
US
Hi all,

Does anybody know in PHP how to use a text link to submit a form? Thanks.

hz
 
Well you could use a url querystring like <A href=&quot;mypage.php?myvariable=myvalue&quot;> but that's pretty much static unless you do some javascript content replacement.
 
This isn't PHP, actually. There's a javascript function submit() that allows you to do this. You access this method by using something akin to:
<a href='#' onClick='document.formname.submit()'>Your text</a>

And that's all there is to it. :)

brendanc@icehouse.net
 
Thanks sophisticate! I wasn't aware of that exact route. By the way, is the onClick only supported by newer browsers?

hz, you could of course then use php to process the inputted variable(s)
 
Inssider:

I believe that onClick is supported by IE 3 an above and NS 4.0x and above. I am not 100% sure, you might want to check I am sure they would have the exact answer.

-Vic

vic cherubini
malice365@hotmail.com
====

Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director

Wants to Know: Java, Cold Fusion, Tcl/TK

====
 
&amp;gt;a href=&quot;tooperate.php?param=1&quot;&quot;&amp;lt;text link&amp;gt;/a&amp;lt;<br>
When 1 is parameter (from variable) to send to tooperate.php
 
<a href=&quot;to_operate.php?param=1>your text</a>
 
<a href=&quot;to_operate.php?param=1&quot;>your text</a>
 
Hi all:

I asked this question when I tried to build a search engine. I want to display the search return result in several pages like normal search engine will do.

The search front page contains a form which has three input fields. when user hit the search submit button, I need the search result display in front of the search form. If matches more than say 10, there should be a link says sth like &quot;next page&quot;, user can either go to next page, or do a new search.

I still haven't found a good solution for that, even I tried all the methods.

What is the standard way of doing that anyway? Could anyone tell me?

Thanks.
hz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top