I searched the forums for this, but couldn't find anything...
Does anyone know of a global that you could use if someone enters a stop word or two few characters (just a letter or number) that would display a error that the word was too common, or too short, etc?
My idea was something like:
Create a global called stopword_error:
# Set query variable to actual query
my $query = $IN->param('query');
my $error = '';
# Determine if query is a stop word
if $query = blahblahblah {
$error = "The word searched is too common...";
}
# Determine if the query is too short
if $query = blahblahblah {
$error = "The word searched is too short...";
}
# Return the error
return $error;
}
Then in your search.html template, you could do:
<%if error%>
<%if stopword_error%>
<p><font color="red"><b><%stopword_error%></b></font></p>
<%else%>
<p><font color="red"><b><%error%></b></font></p>
<%endif%>
<%endif%>
Being so new to perl, I'm not sure how to make this work. Does anyone have any ideas on this?
Sean
Does anyone know of a global that you could use if someone enters a stop word or two few characters (just a letter or number) that would display a error that the word was too common, or too short, etc?
My idea was something like:
Create a global called stopword_error:
Code:
sub { # Set query variable to actual query
my $query = $IN->param('query');
my $error = '';
# Determine if query is a stop word
if $query = blahblahblah {
$error = "The word searched is too common...";
}
# Determine if the query is too short
if $query = blahblahblah {
$error = "The word searched is too short...";
}
# Return the error
return $error;
}
Then in your search.html template, you could do:
<%if error%>
<%if stopword_error%>
<p><font color="red"><b><%stopword_error%></b></font></p>
<%else%>
<p><font color="red"><b><%error%></b></font></p>
<%endif%>
<%endif%>
Being so new to perl, I'm not sure how to make this work. Does anyone have any ideas on this?
Sean