Programming

Programming questions? Ask a programmer for answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

The search function on my Russian Website does not work. I…

Customer Question
The search function on...

The search function on my Russian Website does not work. I get a 500 Error.
1. Click on Поиск which is the second item from the top of the left navigator panel. The search page will come up.
2. Enter a few characters, such as onan. They do not have to be Russian.
3. Click the search button. I get the following error.
500 Server Error
A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again.
________________________________________
1. URL: http://russian.godsplanforlife.org/cgi-bin/search.plThe exact same system works on the English, Spanish and French sites.The search.pl file, located in the cgi-bin folder is identical in all three sites except for one line that describes the root folder to search.I can discuss various troubleshooting steps that I have taken.

Technician's Assistant: Is there a specific language you're coding in?

Perl supported by Dreamweaver

Technician's Assistant: What's your objective for this Perl project?

To get the search function working on the Russian page.

Technician's Assistant: Anything else you want the programmer to know before I connect you?

Not yet.

Submitted: 25 days ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Customer reply replied 25 days ago
I tried to add the search.pl file but an unknown error occurred.
Customer reply replied 25 days ago
The websites that work are:
godsplanforlife.org
spanish.godsplanforlife.org
french.godsplanforlife.org
Customer reply replied 25 days ago
Only the russian site search button does not work:
russian.godsplanforlife.org
Customer reply replied 25 days ago
I tried placing the English and then the Spanish search.pl files on the russian site in the cgi-bin folder and they still yielded the 500 error. I have checked that the cgi-bin folder has 755 permissions.
Customer reply replied 25 days ago
I called Bluehost 3 times and they kept saying that the problem is with my search.pl file.
Customer reply replied 25 days ago
Since the file attachment does not work, here is the search.pl file:#!/usr/bin/perl
#search.pl
#All utf8 specifications are essential in order to maintain utf8 encoding in the search field and on the search page.
#utf8 encoding is very important when there are foreign language characters in the search term.
#See http://stackoverflow.com/questions/627661/how-can-i-output-utf8-from-perl/627975#627975 for a good analyis of utf8 issues.use open IN => ":encoding(utf8)"; # Files, HTML output and error messages
binmode STDOUT, ":utf8";# The next four lines import special modules.
use CGI qw( -utf8 );
binmode STDIN; # Don't corrupt the CGI request
use CGI::Carp qw(fatalsToBrowser);
use File::Find;$cgi=new CGI();my $cgi = CGI->new();print $cgi->header(-type => 'text/html', -charset => 'utf-8');$search_term = $cgi->param('search_term');
$page = $cgi->param('page');my $search_term = $cgi->param('search_term');#The root directory is defined by the web hosting company. In this case it is Bluehost using Linux servers.
$root_dir = "/home2/godspla1/public_html/russian";$root_dir =~ s|/$||; #get rid of trailing slash$html_lines= "";#Specify directories to avoid searching.
$excluded = "cgi-bin|cgi_use|derived|images|_notes|_overlay|vti|_vti_cnf";#Walk the directory tree;
#open the file and look for the term.
#See http://perldoc.perl.org/File/Find.html for how the "find" function works.
#\&search refers to the subroutine search() that will do the searching.
find( \&search, $root_dir ) if $search_term;$html_lines ||= "<tr><td>No results found</td></tr>";$search_results = qq{<table border="0" width="100%" align="center">}
.$html_lines.qq{</table>};#Open the requested page to put in the results.
open (RESULTS, "$root_dir/$page") or die "Can't open results page ($root_dir/$page): $!";#Substitute the search results and replace the search term too.
# see http://www.gossland.com/perlcourse/intro/flow for an explanation of while loops.
while ( <RESULTS> ) {#Move the point of printing insertion down to the results area below the form.
s{<!-- search_results -->}{$search_results};
# s{<!-- search_results -->}{căutării}; This was a test.s{name="search_term"\s*?value=""}
{name="search_term" value="$search_term"};
print;
}
close RESULTS;#----- This subroutine uses the find command on line 28 to find the search term and build html strings.
sub search() {$seen = 0;$URL = $File::Find::name;
# !~ means not equal
# -f means the file is a normal file
#Exclude the exluded directories, sidebar.html and footer.html from the search. Files must be html.
if ( $URL !~ m/$excluded|sidebar|footer|vti/ and -f and /.html?/ ) {
$file = $_;
open FILE, $file;
@lines = <FILE>;
close FILE;#Grab the title, and the file name. We could even grab some context, but it gets trickier.
#Each element ($_) of the @lines array is one paragraph from the original file.
for ( @lines ) {$title = $1 if m|<title>(.*?)</title>|;
#The Q and the E are delimiters to escape interpretation of the contents between them as a regular expression.
#Increment $seen by one, which makes it true, if the match is seen.
$seen++ if /\Q$search_term\E/i;
$seen-- if m/\Q$search_term<\/a>\E/i;
}if ( $seen ) {
$URL =~ s|$root_dir||;#Format the found results into URL, title.
$html_lines .= qq{<tr><td><a href="$URL">$URL</a>};
$html_lines .= qq{</td><td>$title</td></tr>\n};
}
}
}
Customer reply replied 25 days ago
The only line that is different among the three search.pl files is the line that defines the root folder:
$root_dir = "/home2/godspla1/public_html/russian";
Answered in 3 days by:
4/3/2018
Programmer: George Sibiya, Computer Hardware Engineer replied 21 days ago
George Sibiya
George Sibiya, Computer Hardware Engineer
Category: Programming
Satisfied Customers: 292
Experience: PhD in Computer Science
Verified

Hi,

Welcome to JustAnswer and thank you for utilizing our services

I will be looking at your code and update you

Regards,

G

Ask Your Own Programming Question
Was this answer helpful?
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7,677
7,677 Satisfied Customers
Experience: MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

ATLPROG is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,131 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

800 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
I have a worksheet with rankings for an award. Each nominee
I have a worksheet with rankings for an award. Each nominee is ranked 1-5. I want to awards points, 6,4,3,2,1 for places 1-5. How do I set up a formula to do this for me? … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,395 satisfied customers
I was trying to run an SQL Between AND statement in Java
Hi I was trying to run an SQL Between AND statement in Java Netbeans. It is connected to mySQL. It says my SQL syntax is wrong. I was just wondering the proper way to write it … read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
Its an excel specific quesion...is there a reasource for
its an excel specific quesion...is there a reasource for that? … read more
Michael Rademacher
Michael Rademacher
MBA
6 satisfied customers
I renewed my software but cant use it. Microsoft word,
I renewed my software but cant use it JA: Which software or app can I help with? Customer: Microsoft word, excel, publisher, access etc JA: What have you tried so far with your Word? Customer: Can not… read more
Elgin Vega
Elgin Vega
IT Consultant
Science Bachellor
129 satisfied customers
How do I find my workbook online. I updated one sent to me
how do I find my workbook online. I updated one sent to me on email and it said it was saved but when I opened it again from the email, it was not updated. … read more
Michael Rademacher
Michael Rademacher
MBA
6 satisfied customers
I need to renew my domain name with you. Sorry I dont
I need to renew my domain name charleychopchop.com … read more
Fran
Fran
IT Consultant
Associate Degree
170 satisfied customers
I'm trying to write this python to test average and grade
Hi, I'm trying to write this python to test average and grade but I can calculate my average. … read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
I cannot add a photo to an excel document from my Mac book
I cannot add a photo to an excel document from my Mac book air … read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
459 satisfied customers
Pick ONE of the following: 1. Ten CodeLab exercises for
Pick ONE of the following:1. Ten CodeLab exercises for STRUCTURES2. Textbok p. 652, problem 3:Corporate Sales Data Write a program that uses a structure to store the following data on a company divisi… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
I have a program need corection. Phyton. Make it correct I
I have a program need corection JA: Is there a specific language you're coding in? Customer: phyton JA: What's your objective? How can we solve this for you? Customer: make it correct I am missing som… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
From the below Java code, extend it and create a few
From the below Java code, extend it and create a few derivative classes, i.e. a Router, a Switch, a Server, a PSU (Power Supply Unit) etc. Each of those new classes has to be declared as extending the… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
I am trying to see how to get rid of the last few charaters
I am trying to see how to get rid of the last few charaters upto and including the dash in the following 2141B-DNM-4 3157E-FC-14 3157E-FC-10/12 3157E-FC-7/8 2157E-FC-6 … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
I have a very simple question about a calculation/formula
I have a very simple question about a calculation/formula that I am trying to set up in Excel 16. … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,395 satisfied customers
Is this wordpress support? I have one site on Blue Host and
I have one site on Blue Host and could not get support there, … read more
Jinsmn
Jinsmn
Systems Administrator
Diplom
1,260 satisfied customers
I can't get the bar at the top of the sheet to show content.
I can't get the bar at the top of the sheet to show content … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
Trying to make a chess board. Trying to reduce the code and
trying to reduce the code and add a function, im using python … read more
Ingo U
Ingo U
Master\u0027s Degree
358 satisfied customers
How do I fill an avery form 8660 address labels from an
how do I fill an avery form 8660 address labels from an excel spread sheet … read more
Michael Rademacher
Michael Rademacher
MBA
6 satisfied customers
How can I change a column of text to numbers? Just reguar
Highlight the column and change and change the format to number. … read more
Jeevan DSouza
Jeevan DSouza
Professor
PhD
3 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x