Changeset 41 for trunk/npemap.org.uk
- Timestamp:
- Oct 15, 2006, 3:15:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/cgi/submit.fcgi
r40 r41 29 29 # If we're given return URL parameters, basic sanity check to stop 30 30 # funny business 31 my $returnlink = '<a href="'. $returnBaseURL . '/">Go back to the start</a>'; 31 32 my $returnlink = '<a href="/tiles/map.html?' .int($cgi->param('easting')/1000). ",".int($cgi->param('northing')/1000) . ',1">Go back</a>'; 32 33 33 34 if (defined $cgi->param('returnX') and ($cgi->param('returnX') =~ /\d+/) and 34 defined $cgi->param('returnY') and ($cgi->param('returnY') =~ /\d+/) and 35 defined $cgi->param('returnZoom') and ($cgi->param('returnZoom') =~ /\d+/)) { 36 $returnlink = '<a href="' . $returnBaseURL . '/tiles/map.html?' . $cgi->param('returnX') . ',' . $cgi->param('returnY') . ',' . $cgi->param('returnZoom') . '">Go back to the map</a>'; 35 defined $cgi->param('returnY') and ($cgi->param('returnY') =~ /\d+/) ) { 36 $returnlink = '<a href="' . $returnBaseURL . '/tiles/map.html?' . $cgi->param('returnX') . ',' . $cgi->param('returnY') . ',1">Go back to the map</a>'; 37 37 } 38 38 … … 76 76 # Now validate the postcode input format 77 77 my $raw_postcode = $cgi->param('postcode'); 78 my $postcode = Geo::Postcode->new($raw_postcode); 78 my $trimmed_postcode = $raw_postcode; 79 $trimmed_postcode =~ s/^\s+//; 80 $trimmed_postcode =~ s/\s+$//; 81 my $postcode = Geo::Postcode->new($trimmed_postcode); 79 82 my ($first, $second, $third, $fourth) = @{$postcode->fragments}; 80 83 my ($outward, $inward); … … 149 152 sub setup_dbh { 150 153 # $dbh is global 151 return $dbh = DBI->connect_cached("dbi:Pg:dbname=npemaps ","npemaps","");154 return $dbh = DBI->connect_cached("dbi:Pg:dbname=npemaps;host=127.0.0.1","npemaps","npemaps"); 152 155 }
Note: See TracChangeset
for help on using the changeset viewer.