Their site is set up with each section having it's own .db file (i.e. section1.db, section2.db etc.). I've managed to get the search for the each of the individual sections to work by using the following link to the search page:
<a href="/cgi-bin/classifieds/classifieds.cgi? db=section1&website=default&language=&session_key=&view_database_button=on"> Search Ads</a> The problem is that the general search for all of the sections at once no longer works. What gets me is that it was working fine on Wednesday (the problem was reported to me on Friday). Here's the link I was using:
<a href="/cgi-bin/classifieds/classifieds.cgi? website=&language=&session_key=">Search Ads</a> This would no longer refer to the search page so i changed the link to:
<a href="/cgi-bin/classifieds/classifieds.cgi? website=&language=&session_key=&view_database_button=on">Search Ads</a> This now takes the user to the search page, but when they try to perform the search they get the following error:
Content-type: text/html
We're sorry, but the script may be down for maintenance. Please try again in a few minutes.For debugging: Specifically, the script was not able to access in the Read Database routine of /home/usr/public_html/cgi-bin/classifieds/library/search.pl at line number 51. Please make sure the path is correctly defined in the db file and that the permissions are correct.
Thinking this was a problem with the search.pl file, I uploaded the file again from a backup, and it still doesn't work. :( I am assuming that it is not a permissions issue as the individual section searches now work.
My guess is that I need to specify which .db files to search, then it will work (please correct me if I'm wrong). How do I specify in the link for it to search all of the .db files at once?
Thanks in advance for the help!
BTW--Any ideas on why this would be working one day and not working the next? Thnx!
[edited by: jatar_k at 9:04 pm (utc) on May 2, 2005]
[edit reason] fixed sidescroll [/edit]
<a href="/cgi-bin/classifieds/classifieds.cgi?website=&language=&session_key=&view_database_button=on"> to
<a href="/cgi-bin/classifieds/classifieds.cgi?website=default&language=&session_key=&view_database_button=on"> The problem isn't with search.pl, it is in another file that search.pl needs. A wrong path in a db file? A wrong path in a config file somewhere?
Since this is all to do with a third party script you would probably be best looking for support from whoever wrote it - do they have a forum?
Unfortunately, my clients purchased this software long before I was hired and they selected a vendor that has no forum and very few knowledgebase articles. This vendor charges $150 US per hour (my client is in Canada so that's around $175-180/hour) for tech support.
You can see why I'm trying to do what I can for them!
What I don't understand is why it was working, then within a couple of days after I was last on the site, this one feature stopped working (I didn't modify any files that day).
I have uploaded the main cgi files from the backup copy I had, including any .pl files that had anything to do with search, and it still does not work.
Any other ideas?
Thanks again!
Are you sure you need that long string at all? Most search scripts are run via a form action like below (taken from another classified script):
<FORM METHOD="post" ACTION="http://www.yourdomain.com/cgi-bin/classifieds/classifieds.cgi">
<INPUT TYPE="hidden" NAME="session_key" VALUE="">
Search for
<input name=keywords type=text size=12 value="">
<INPUT TYPE="hidden" NAME="case_sensitive" value="">
<INPUT TYPE="hidden" NAME="results_format" VALUE="headlines">
<INPUT TYPE="hidden" NAME="query" value="keyword_plus">
<INPUT TYPE="hidden" NAME="search_and_display_db_button" VALUE="Search!">
using
<select name="boolean" size=1>
<OPTION value="any terms">any of my keywords
<OPTION value="all terms">all of my keywords
<OPTION value="as a phrase">this exact phrase
</select>
<INPUT TYPE="submit" VALUE="Search!">
The code for the form looks right to me, but maybe I'm missing something? Here it is:
<FORM METHOD =" post" ACTION =" [domain.com...]<INPUT TYPE =" hidden" NAME =" db"
VALUE =" ">
<INPUT TYPE =" hidden" NAME =" website"
VALUE =" default">
<INPUT TYPE =" hidden" NAME =" language"
VALUE =" ">
<INPUT TYPE =" hidden" NAME =" session_key"
VALUE =" ">
<center>
<table border=0 cellpadding=4 cellspacing=4 bgcolor="#ffffff">
<tr><td colspan=2>Advanced Search</td></tr>
<tr>
<th align=left>Find Keywords:</th>
<td><input name=keywords type=text size=30></td>
</tr>
.
.
.
<tr>
<th align=left>Ads Must Match</th>
<td><SELECT NAME="boolean">
<OPTION value="any terms">any of my keywords
<OPTION value="all terms">all of my keywords
<OPTION value="as a phrase">this exact phrase
</SELECT></td>
</tr>
<tr><tr>
<td colspan=2>
<INPUT TYPE="hidden" NAME="query" value="advanced_search">
<INPUT TYPE =" hidden" NAME =" search_and_display_db_button"
VALUE =" Search for Matching Ads">
<INPUT TYPE =" submit" VALUE =" Search for Matching Ads"></center>
It seems to me that the action is right, but I need to get the "backend" to put the value to search all the databases in the
<INPUT TYPE =" hidden" NAME =" db" VALUE =" "> field. I was able to do this for the individual sections by putting db=sectionx in the referring url. Is there a similar "trick" to get it to insert all of the databases in the hidden field value? (it may not be elegant, but if it works I'll be happy!)
Thanks again!
What I don't understand is why it was working, then within a couple of days after I was last on the site, this one feature stopped working (I didn't modify any files that day).
I read all, then skimmed again, and don't see anywhere that you've checked execute permissions. If the require/include is indeed in the correct place, **something** may have changed or reset the permissions on that file.
OR
It could be that the server config was reset and your include needs to be named .cgi instead of .pl. How can this happen? I've worked with an auto-hosting setup that would regularly override our server config files. That is, we config'ed .pl and .cgi to execute, but something kept setting it back to .cgi only, munging up my includes.
Thanks for the permissions tip. I finally found a document which told what permissions each file required and have changed everything. It didn't fix this particular problem, but it did solve another issue that I've been having with the site. :)
It could be that the server config was reset and your include needs to be named .cgi instead of .pl. How can this happen? I've worked with an auto-hosting setup that would regularly override our server config files. That is, we config'ed .pl and .cgi to execute, but something kept setting it back to .cgi only, munging up my includes.
If this were the case, wouldn't all of the perl components of the site not work? What's the best way to check to see if this is what's happened?
The Contractor:
Thanks for your offer! I will do the google search as you suggest after lunch, and hopefully that will give me some clues. If I still can't get it going after that, I'll send you the info.
Thanks again!
The way to find out, if you can't locate and review the server config, is to just run a hello world script in the target directory with both extensions.