Lunarpages Web Hosting Forum

Author Topic: First time with CGI  (Read 8401 times)

Offline snickn

  • Jabba the Hutt
  • *****
  • Posts: 543
    • http://www.snickn.com
First time with CGI
« Reply #30 on: May 25, 2003, 11:11:30 PM »
should be cgi-bin/quote.cgi instead of /kendal2/www/.....

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
First time with CGI
« Reply #31 on: May 26, 2003, 07:11:32 AM »
Ok, lets try your SSI out for a sec:

Make a new .txt file and put whatever you want in it eg:

"If this shows it works"

save it as ssi.txt

now in your .shtm file insert:

<!--#include file="ssi.txt" --> (copy and paste to get the exact spacing etc).

upload both files into the same directory, and try to open the .shtm file. It SHOULD show the contents of the ssi.txt file.
----

Also, you may want to try the following code in your .shtml file

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>
<!--#exec cgi="cgi-bin/quote.cgi"-->
</body>

</html>

----
It may just be a problem with absolute referencing.

You may also want to try chmod the cgi script to 775 (compared to 755 or 777).


- Ed :-)

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
First time with CGI
« Reply #32 on: May 26, 2003, 07:13:28 AM »
Ifyour still having problems, I am goign to try installing quote.cgi on my server and running it through SSI and I'll write up a step by step guide. Let me know!

- Ed :-)

Offline Kendall

  • Intergalactic Superstar
  • *****
  • Posts: 137
    • http://www.kendallepark.com
First time with CGI
« Reply #33 on: May 26, 2003, 10:26:15 AM »
*sigh*


i still dont work i have no clue what im doing wrong!

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
First time with CGI
« Reply #34 on: May 30, 2003, 12:46:10 AM »
ok I just threw the script into my server to see what it does.

You can run the script directly from the cgi bin to check it's working ok.

This is the script working here on my server:

http://crazy.lunarpages.com/quote.shtml

You will see you get a different random quote on every page refresh. :)

Ignore the SSI call the script author has given you and use this:
Code: [Select]
<!--#exec cgi="cgi-bin/quote.cgi" -->

Name your page quote.shtml or anything you like so long as it's .shtml

I keyed into your script directly, and it doesn't appear to be loaded where I was looking.
If your quote.cgi script is directly in your cgi-bin (not in a folder) it should work for you on the url:
http://www.kendallepark.com/cgi-bin/quote.cgi

But it doesn't, so upload quote.cgi and quotes.dat to your cgi-bin and use chmod 755
There is nothing you need to configure to get the script to run.

Upload a webpage called quote.shtml to your root html directory (where your main index page is)
And in it just put this:
Code: [Select]
<!--#exec cgi="cgi-bin/quote.cgi" -->

then go to your browser and type:
http://www.kendallepark.com/quote.shtml

Or if you want to run the script directly from the cgi-bin type in:
http://www.kendallepark.com/cgi-bin/quote.cgi

This should work fine :P

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
First time with CGI
« Reply #35 on: May 30, 2003, 12:48:29 AM »
You can then edit quotes.dat to make as many quotes as you like, and have them say whatever you like :)

Offline Kendall

  • Intergalactic Superstar
  • *****
  • Posts: 137
    • http://www.kendallepark.com
First time with CGI
« Reply #36 on: May 30, 2003, 11:38:57 AM »
well i just did what you said

uploaded what i wanted

quote.cgi
quote.dat
quote.shtml

set everything to 755

www.kendallepark.com/quote.shtml and nothing....

is there something on cpanal that enables cgi? or maybe cgi doesnt work on my server?

the only thing i have on the page is
Code: [Select]
<!--#exec cgi="cgi-bin/quote.cgi" -->
ive tryed it with like
Code: [Select]
<body></body>
and still nothing

i changed nothing i put the quotes i wanted in and still nothing from what i got from your post you dident change anything besides the quotes that are to be displayed so i did what i thought you said and still nothing :(

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
First time with CGI
« Reply #37 on: May 30, 2003, 01:09:50 PM »
cgi scripts are enabled on your server.
I've no idea what is going wrong with regards to your script.
As you can see, both the script and the ssi are working well.
Without access to your server it's impossible for me to see I'm afraid.
There is nothing you need to do to the script, just upload it, chmod to 755 and type the url into your browser.

Offline Kendall

  • Intergalactic Superstar
  • *****
  • Posts: 137
    • http://www.kendallepark.com
First time with CGI
« Reply #38 on: May 30, 2003, 01:13:43 PM »
are you using the scripts i said like in my first post or a diffrent one?

maybe we can get a siteadmin in hear?

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
First time with CGI
« Reply #39 on: May 30, 2003, 01:28:41 PM »
ok I typed in:
http://www.kendallepark.com/cgi-bin/quote.cgi
And got an internal server error, which is encouraging. :)
So the server is finding your file, but it's most likely the chmod is wrong .
Which ftp client are you using to set your chmod?

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
First time with CGI
« Reply #40 on: May 30, 2003, 01:30:22 PM »
I downloaded the script from the url you gave earlier in your post :)

Offline Kendall

  • Intergalactic Superstar
  • *****
  • Posts: 137
    • http://www.kendallepark.com
First time with CGI
« Reply #41 on: May 30, 2003, 01:38:45 PM »
im using WS_FTP i set all the files i said above to 755 and still dont work.

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
First time with CGI
« Reply #42 on: May 30, 2003, 05:48:43 PM »
In WS_FTP you should see an option for "ASCII" "Binary" or "Auto". Select the ASCII option, and try uploading the scripts again. Making sure you upload into the directory (on yoru server):
public_html/cgi-bin

If that still doesn't work. You might want to try uploading through CPanel, and doing it all from there.

Keep us posted on your progress!

- Ed :-)

Offline Kendall

  • Intergalactic Superstar
  • *****
  • Posts: 137
    • http://www.kendallepark.com
First time with CGI
« Reply #43 on: May 30, 2003, 06:00:53 PM »
it uploads the files in ASCII auto..

gonna try cpanal

Offline Ed

  • Berserker Poster
  • *****
  • Posts: 5156
    • Joke A Whenever
First time with CGI
« Reply #44 on: May 30, 2003, 06:06:11 PM »
You might also want to try re-downloading the cgiscript from the website, you may have changed it or something, and accidently corrupted the code or something. All it takes is an extra character to make it not work!

- Ed :-)