473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CGI Script not Loading

I'm a beginner with perl/cgi.
and im not ableto see the output of my cgi file on the browser.. Can anyone help me out.

I have an html file...from which i want to go open a cgi file...

index.html is in NEW_ONE folder
menu.cgi is in NEW_ONE folder too.

index.html

Expand|Select|Wrap|Line Numbers
  1. <HEAD>
  2. <TITLE>CP Web Tool</TITLE>
  3. </HEAD>
  4. <body>
  5.  
  6. <font size=3>
  7. <A HREF="/cgi-bin/cgidir/ebh022/CP_tool/NEW_ONE/menu.cgi">LINK TO CGI PAGE </A>
  8.  
  9. </body>
  10. </HTML>
  11.  
menu.cgi

Expand|Select|Wrap|Line Numbers
  1. #!/org/www/cgidir/iden_ergo/ebh022/perl/perl
  2. BEGIN
  3. {
  4. unshift( @INC, "cgi-lib" );
  5. unshift( @INC, "perl/lib/site_perl/5.005" );
  6. unshift( @INC, "perl/lib/site_perl/5.005/PA-RISC1.1" );
  7. }
  8.  
  9. print <<EOF;
  10. Content-type: text/html
  11.  
  12. <HTML>
  13. <HEAD>CGI FILE
  14. </HEAD>
  15. <BODY BGCOLOR="WHITE">
  16. THIS IS THE BODY OF THE CGI FILE..
  17. </BODY>
  18. </HTML>
  19. EOF
  20.  

Now the problem I'm getting is ... from the html file im not able to go the cgi file...
when i click on the link of the html page...it goes to the next page where it displays the MENU.CGI file contents (i.e. #!/org/www/cgidir/iden_ergo/ebh022/perl/perl
BEGIN
.....
)

whereas it shud give the result of MENU.CGI..

can u tell me what is the problem????

is there anything wrong with the path that im givin...
#!/org/www/cgidir/iden_ergo/ebh022/perl/perl

but other files on the server are working with this path (i work in a company, so the server of that company), so i dont think this is the issue..

please let me know...im not able to move ahead without this.

Thanks
Ravi
Mar 12 '07 #1
4 1812
KevinADC
4,059 Expert 2GB
the problem appears to be that the server is not setup to run scripts from the directory you are using.
Mar 12 '07 #2
the problem appears to be that the server is not setup to run scripts from the directory you are using.

Problem got Sorted.
The problem was with the Path I was giving.

Thanks for ur reply.
Mar 14 '07 #3
miller
1,089 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. #!/org/www/cgidir/iden_ergo/ebh022/perl/perl
  2. BEGIN
  3. {
  4. unshift( @INC, "cgi-lib" );
  5. unshift( @INC, "perl/lib/site_perl/5.005" );
  6. unshift( @INC, "perl/lib/site_perl/5.005/PA-RISC1.1" );
  7. }
  8.  
Hi Ravi,

Glad you figured out your problem.

I would like to make one stylistic suggestion for your code. Instead of manually editting the @INC array, take advantage of the lib pragma:

perldoc lib

This would change your above code in the following way:

Expand|Select|Wrap|Line Numbers
  1. #!/org/www/cgidir/iden_ergo/ebh022/perl/perl
  2.  
  3. use lib "cgi-lib";
  4. use lib "perl/lib/site_perl/5.005";
  5. use lib "perl/lib/site_perl/5.005/PA-RISC1.1";
  6.  
Also, I would generally dissuade anyone from using relative paths for anything, including your include directories. Nevertheless, at the very least change your code to the above as that is the standard way of modifying @INC.

- Miller
Mar 14 '07 #4
Thanks Miller for that one....
Mar 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ola Fjelddahl | last post by:
hi. I load a script dynamically and it works * everytime with IE6. * sometimes! with Mozilla1.5 <- makes me curious * never with Opera7.11 all tests on WindowsXP. With "sometimes" I mean
3
by: Christopher Benson-Manica | last post by:
I appreciate all the responses to my earlier post about accessing named elements. However, I'm still wondering about my actual problem, which is that I need to initialize some arrays of named...
6
by: Curious George | last post by:
I have a page that takes about 10 seconds to load the first time it is run. I would like to first display a little animated gif telling the user that the page is loading. How do I do this with...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
2
by: hbchai | last post by:
I'm adapting the ajax-like asynchronous request pattern mentioned in this article: http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html?page=2 for my Sudoku...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
2
by: boczek | last post by:
Hello all. I'm writing a small async webapp. in JavaScript and I'm using <script> element technique to load data. I'm usign <scriptbecause of cross domain restrictions with XmlRequest. The...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
14
by: Tony | last post by:
I have a select with an onchange - it works find in Firefox, but in IE 6 I get an error: Object Expected. I have simplified things drastically, and still get the error. The HTML: <select...
2
by: LayneMitch via WebmasterKB.com | last post by:
Hello. I posted this earlier with the full code of the JavaScript file I'm trying to open. I'm posting this again, because the file is not the problem. I seem to be having a 'windows' problem...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.