diff options
Diffstat (limited to 'form.cgi')
-rwxr-xr-x | form.cgi | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,10 +26,10 @@ if ($q->param('url')) { # create database handler my $dbh = DBI->connect("dbi:Pg:dbname=purl") or die $DBI::errstr; - + # SQL Query my $query = qq(SELECT shorts.url FROM shorts WHERE shorts.short = ?;); - + # Check if short exists. If it does, generate a new one. while (my $url = $dbh->selectrow_array($query, undef, $short)) { $results .= "Your short exists. Generating new.<br>\n"; @@ -45,7 +45,7 @@ if ($q->param('url')) { my $proto = $ENV{'HTTPS'} eq "on" ? 'https://' : 'http://'; # http/https - my $shortURL = $proto . $ENV{'SERVER_NAME'} . '/' . $short; + my $shortURL = $proto . $ENV{'SERVER_NAME'} . '/+' . $short; $results .= "URL: $url<br>\n"; $results .= "Shortened to: <a href=\"$shortURL\">$shortURL</a><br>\n"; $results .= "<hr>\n"; |