LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro (https://www.linuxquestions.org/questions/linux-networking-3/do-i-have-a-path-problem-an-apache2-problem-or-a-javascript-problem-or-any-other-pro-852982/)

rblampain 12-29-2010 03:50 AM

Do I have a path problem, an Apache2 problem or a Javascript problem or any other pro
 
I have an unusual site that uses "frames". Beside frames for navigation (at the top), 2 frames (named "pane_l" and "pane_r" for left pane and right pane) are used for content and the site is multilingual.
The "index.htm" is a pure HTML frameset document that loads the same pure HTML form in each of these panes (main_prog_l.htm and main_prog_r.htm), this form asks the visitor through 'radio' buttons to select a language, by name from one pane or by flag from the other pane.

The first one to be selected (Submitted) calls a CGI that construct a path to the pages of the site and display splash pages in both panes in the wanted language through included javascript code and this is where I am having problems, I cannot find how to make a path that works.

The way these panes are changed in the wanted language is as follows:
a CGI programs (lingo_l.cgi or lingo_r.cgi) is called and returns a HTML script that is displayed in the same pane, javascript code in this HTML calls another CGI script to change the other pane.

The difference between these CGI programs is:
if the language is selected from "pane_l", "lingo_l.cgi" replaces "pane_l" with "splash_l" and calls (through javascript function) "pan_r.cgi" to replace "pane_r" with "splash_r".
if the language is selected from "pane_r", "lingo_r.cgi" replaces "pane_r" with "splash_r" and calls (through javascript function) "pan_l.cgi" to replace "pane_l" with "splash_l".

If document root is '/first_dir/second_dir/' and 'main_prog_l.htm' and 'main_prog_r.htm' are in the root directory, finding and executing these with a path as "main_prog_?.htm" works correctly but pressing "Continue." (Submit) in any triggers 'action="en/lingo_l.cgi"' (English directory) in the form to make the path "/first_dir/second_dir/en/lingo_l.cgi", this gives the following errors in apache2 error.log:
. . File does not exist: /first_dir/second_dir/en/en, referer: http://127.0.0.1/en/lingol.cgi
. . File does not exist: /first_dir/second_dir/en/en, referer: http://127.0.0.1/en/panr.cgi
If the "en/" is remove from all paths in these 'referers, Apache2 gets into an endless loop and I get the screen flickering the correct rendering on and off of files for which it does not have the correct path with a message at the bottom of the screen saying: "waiting for 127.0.0.1. .", the error log says: ". . File does not exist: /first_dir/second_dir/favicon.ico"

The problem mentionned above happens when testing on the same machine containing the server.
All the CGI scripts are preceded by the correct header (Content-type: text/html) and 2 new lines as required, followed by the HTML code to return, there is no messages in the error log in that respect.
All generated HTML code is tested and found valid at http://validator/w3c.
I have javascript debugger on and, after a few initial mistakes, there is no more error messages popping up.

Schematically, it goes like this:
. . . . . . . . . . . . . . . .index.htm (html frameset)
. . . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . . . . . . . . . . . .v. . . v
. . . . . . . . . . . . . . . . . . v. . . . . . v
. . . . . . . . . . . . . . . . .v. . . . . . . . . v
. . . . . . . . . . . . . . . v. . . . . . . . . . . . v
. . . . . . . . . . . . . .v. . . . . . . . . . . . . . . v
. . . . . . . . . . . . v. . . . . . . . . . . . . . . . . . v
. . . . . . . . .in pane_l. . . . . . . . . . . . . . . . . in pane_r
. . . . . . main_prog_l.htm. . . . . . . . . . . . . . main_prog_r.htm (both pure html)
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . if selected. . . . . . . . . . . . . . . . . . . . v
. . . . . . ===========. . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . lingo_l.cgi (renders 'splash_l' HTML+js). . . . . .v
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . v. . . . . . . . . . . . . . . . . . . . . . v
. . . . . . pane_r.cgi (renders 'splash_r'). . . . . . . . . .v
. . . . . . continued. . . . . . . . . . . . . . . . . . . . . v
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v
. . . . . . . . . . . . . . . . . . . . . . . . . . . .if selected
. . . . . . . . . . . . . . . . . . . . . . . . . . . .===========
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v
. . . . . . . . . . . . . . . . . . . . . . . . . . . .lingo_r.cgi (renders 'splash_r' HTML+js)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v
. . . . . . . . . . . . . . . . . . . . . . . . . . . .pane_l.cgi (renders 'splash_l')
. . . . . . . . . . . . . . . . . . . . . . . . . . . .continue


Hope this makes sense.

Any help or hint most welcome.

Thank you for your help.


All times are GMT -5. The time now is 01:08 AM.