CGI: Linking to a dynamic CGI page

mattmc97
07-15-2003, 08:40 AM
Hello all!

I am doing a website at work and I am trying to pull information from the US Census page on new building permits for Houston. I just want to link to the page that has the info for Houston, I do not have to pull the information over. The problem is that the web page appears to be done with forms and the work is done server side so there is no web page I can copy the html address from to get the finished page.

The Website address is: http://censtats.census.gov/cgi-bin/bldgprmt/bldgdisp.pl

and I found this by looking at the source, which shows the state (48Texas) being selected and the County (Harris = 323500) but I do not know how to send this information from the link on my page.

(From source code)
<form method=post action=bldgdisp.pl>
<input type=hidden name="State" value="48Texas">
<input type=hidden name="County" value="323500">
<input type=hidden name="ret_opt" value="Place">


I would like to be able to send the values so the user doesn't have to figure out where to go.

Something like:

<a href="http://censtats.census.gov/cgi-bin/bldgprmt/bldgdisp.pl"
<form method=post action=bldgdisp.pl>
<input type=hidden name="State" value="48Texas">
<input type=hidden name="County" value="323500">
<TARGET="_blank">Building Permits</a>

But that still doesn't work! Is there a way to pass these values automatically??

Thanks in advance!

mattmc

PWNettle
07-15-2003, 01:46 PM
As long as you can find out the exact form input names to submit and valid values for them you could do it with a form submission and submit the form by a link on your page. You are close...try something more like this:

<form name="frmCensus" method="post" action="http://censtats.census.gov/cgi-bin/bldgprmt/bldgdisp.pl">
<input type=hidden name="State" value="48Texas">
<input type=hidden name="County" value="323500">
<input type=hidden name="ret_opt" value="Place">
</form>

<a href="" onclick="frmCensus.submit(); return false;">Building Permits</a>

If you want to make it so that hovering over your link doesn't show a misleading URL in the window's status bar add this onMouseOver event to your link:

onmouseover="window.status=''; return true;"

What this does is build a (hidden, since none of those elements will show) form that contains all the info you need to submit including the full URL of bldgdisp.pl). The form is submitted by the onclick event in the link and the links normal behavior is cancelled with the 'return false'.

Paul

mattmc97
07-15-2003, 01:56 PM
I will try it.

Thanks.

mattmc

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum