P
Paul F. Johnson
Hi,
I have a very simple form which is supposed to take an entry from the
webpage form and then redirect accordingly.
The form looks like this
<form method="POST" name="cgi/articles.cgi">
<select>
<option value="#" selected>Choose an article...</option>
<option value="overview">Overview</option>
<option value="defining">Defining 'Community' Arts</option>
<option value="whybigisbeautiful">Why Big is Beautiful</option>
<option value="whybigisn't">Why Big isn't Always Beautiful</option>
<option value="whyfilm">Why Film?</option>
<option value="processversusproduct">Process Versus Product</option>
<option value="devisingmethodologies">Devising Methodologies</option>
<option value="leightech">Using Mike Leigh's Techniques</option>
<option value="workingwithnon-actors">Working with Non-Actors</option>
<option value="funding">Funding and Political Perspectives</option>
<option value="conclusions">Conclusions</option>
<option value="authors">About the Authors</option>
</select>
<input type="submit" value="Go!">
</form>
with the cgi script looking like this
#!/usr/bin/perl -wT
use CGI;
use CGI::Carp qw(fatals_to_browser);
use strict;
my($q) = new CGI;
print q->header("Content type: text/html\n\n");
read (STDIN, $input,$ENV{'CONTENT_LENGTH'});
if ($input eq '#')
{
print q->header("Content type: text/html\n\n");
exit;
}
$url = $input + '.html';
print $q->redirect($url);
This should do the redirection for me when someone clicks on the "Go!"
button (unless I've completely messed up somewhere [which is not unknown
;-p]).
I'm trying to rewrite something called cssscriptdict - it's something
revolting you can see if you go to
http://www.smmp.salford.ac.uk/dixonpeters. It looks like an unholy mix
of CSS and JS - I'm trying to vanquish the JS and these scripts.
This cssscriptdict stuff is only ever used for the same dropdown menu on
a number of pages. If I can change it to a #include which can use the
cgi script, then life will be happier (well, it will for me).
So, is the CGI wrong, the form wrong or both?
TTFN
Paul
I have a very simple form which is supposed to take an entry from the
webpage form and then redirect accordingly.
The form looks like this
<form method="POST" name="cgi/articles.cgi">
<select>
<option value="#" selected>Choose an article...</option>
<option value="overview">Overview</option>
<option value="defining">Defining 'Community' Arts</option>
<option value="whybigisbeautiful">Why Big is Beautiful</option>
<option value="whybigisn't">Why Big isn't Always Beautiful</option>
<option value="whyfilm">Why Film?</option>
<option value="processversusproduct">Process Versus Product</option>
<option value="devisingmethodologies">Devising Methodologies</option>
<option value="leightech">Using Mike Leigh's Techniques</option>
<option value="workingwithnon-actors">Working with Non-Actors</option>
<option value="funding">Funding and Political Perspectives</option>
<option value="conclusions">Conclusions</option>
<option value="authors">About the Authors</option>
</select>
<input type="submit" value="Go!">
</form>
with the cgi script looking like this
#!/usr/bin/perl -wT
use CGI;
use CGI::Carp qw(fatals_to_browser);
use strict;
my($q) = new CGI;
print q->header("Content type: text/html\n\n");
read (STDIN, $input,$ENV{'CONTENT_LENGTH'});
if ($input eq '#')
{
print q->header("Content type: text/html\n\n");
exit;
}
$url = $input + '.html';
print $q->redirect($url);
This should do the redirection for me when someone clicks on the "Go!"
button (unless I've completely messed up somewhere [which is not unknown
;-p]).
I'm trying to rewrite something called cssscriptdict - it's something
revolting you can see if you go to
http://www.smmp.salford.ac.uk/dixonpeters. It looks like an unholy mix
of CSS and JS - I'm trying to vanquish the JS and these scripts.
This cssscriptdict stuff is only ever used for the same dropdown menu on
a number of pages. If I can change it to a #include which can use the
cgi script, then life will be happier (well, it will for me).
So, is the CGI wrong, the form wrong or both?
TTFN
Paul