diff options
author | Dennis Eriksen <d@ennis.no> | 2020-05-15 10:34:47 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2020-05-15 10:34:47 +0200 |
commit | 9f428482a4ed20f36512f8255e8e80075c239af5 (patch) | |
tree | 91870737334d6db68f2ac69ea2648f3d24d7f1d2 /form.cgi | |
parent | we now support curling the form without getting all of the HTML in response (diff) | |
download | purl-9f428482a4ed20f36512f8255e8e80075c239af5.tar.gz |
I'm adding a + in front of the short URL, because I want to use another domain for this. It should probably be optional, but what the heck. I'm probably the only one using this.
Diffstat (limited to '')
-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"; |