Click to See Complete Forum and Search --> : Perl syntax to strip default value?
bobafifi
02-18-2003, 10:08 AM
Anybody know what the Perl syntax is for stripping the default value "http://" in the following form?
http://www.usedflutes.com/addpage_URL.html
Many thanks in advance,
-Bob
Nedals
02-18-2003, 01:49 PM
In your form use the default 'http://'
In your script (using strict, of course!!)
my $URL = $q->param('url');
if ($URL =~ /^http:\/\/(.*)/) { # check to see if anything was added after the 'http://'
if (!$1) {
... nothing changed so ignor or whatever
} else {
... URL was added in the text element and is ready to use
}
} else {
... it was changed but the 'http://' was removed, so send an
error message OR maybe add back the 'http://
}
I can't get this to format nicely
celebguy_dv
03-04-2003, 01:52 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)