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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI from a normal hyperlink - newbie alert

Status
Not open for further replies.

snookmz

Programmer
Apr 17, 2001
46
AU
g'day all

Im wondering if you can have a normal hyperlink act as a 'form' button.. i.e. POST some info to a perl script on my server to perform a particular action..

Just wondering if this is posible on a html type IIS server, i.e. no ASP or PHP enabled...

thanks in advance! :) /-------------------------------------
| I always have been, and
| always will be, a newbie :)
\-------------------------------------
 
javascript:
Code:
<html><head>
Code:
<script>
function mySubmit(){document.myForm.submit();}
</script>
Code:
</head><body>
<form name=&quot;myFORM&quot; action=&quot;whatever.cgi&quot;>
<input type=&quot;text&quot; name=&quot;myInputField&quot;>
</form>
<a href=&quot;
Code:
javascript:mySubmit();
Code:
&quot;>Submit</a>
</body></hhtml>
 
thanks for your help gerrygerry but it doesn't seem to work... Says 'error on page'... are you sure its all syntacticly correct???

cheers /-------------------------------------
| I always have been, and
| always will be, a newbie :)
\-------------------------------------
 
or.... build the uri for the action you want taken and simply use it for the href.
Code:
print '<a href=&quot;[URL unfurl="true"]http://yourserver.com/cgi-bin/code.pl?key1=value1&key2=value2&quot;>[/URL]
           The text for your link or an img tag or whatever</a>';
HTH


keep the rudder amid ship and beware the odd typo
 
Whoops -- case sensitivity:
Code:
<html><head>
<script>
function mySubmit(){document.myForm.submit();}
</script>
</head><body>
<form name=&quot;myFORM&quot; action=&quot;whatever.cgi&quot;>
<input type=&quot;text&quot; name=&quot;myInputField&quot;>
</form>
<a href=&quot;javascript:mySubmit();&quot;>Submit</a>
</body></hhtml>
 
Thank you goBoating and gerrygerry, goBoatings answer was actually closer to what i needed, and iv got it to work now.. Thanks both of you for your help, it was greatly appreciated :) /-------------------------------------
| I always have been, and
| always will be, a newbie :)
\-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top