Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Simple cgi problem/w2k

 [1/9] from: tim:johnsons-web at: 2-Jan-2002 11:24


* Dr. Louis A. Turk <[louisaturk--eudoramail--com]> [020102 10:16]:
> Mike, > > Thanks. I am on a W2K server. Nevertheless, I realize that my script is > not succeeding in calling the rebol interpreter as I thought.
Louis: See my previous post... Was phrased as per windows 98/NT using Personal Web Server. If you are on a remote server, those instructions may not be appropriate: That server is probably using IIS. Caveats: Some ISPs will not support rebol/core on W2k because if you examine the content at http://www.rebol.com/platforms.html no mention is made of win2000 as regards to /core copy: Windows 95/98/NT iX86 Released 2.5.0.3.1 HOWEVER: I do note that at http://www.rebol.com/view-platforms.html The content DOES show that /view is supported by win2k copy: REBOL/View: Windows 95, 98, 2000, NT, ME, XP (exe) Windows 95, 98, 2000, NT, ME, XP (zip) Tim core031.zip
> Louis > At 08:35 AM 1/2/2002 -0500, you wrote:
<<quoted lines omitted: 51>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [2/9] from: rich:dogsoldier at: 2-Jan-2002 14:41


rebol\core woirks fine on win2k pro and server. check the shebahg line - might need something like #!c:/www/rebol/rebol.exe --cgi --script or #!c:/www/rebol/rebol.exe --cgi --script What webserver is being used? If it is Apache make sure that it is configured properly and then try #!c:/www/rebol/rebol.exe -cs Rich DogSoldier.com Tim Johnson wrote:
> * Dr. Louis A. Turk <[louisaturk--eudoramail--com]> [020102 10:16]: > > Mike,
<<quoted lines omitted: 84>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- ----------------------------------------------------------------------------- "He who will trade freedom for security will get, nor deserve, neither" ---------- On the net, you either lead the pack or play with the puppies.

 [3/9] from: al:bri:xtra at: 3-Jan-2002 10:18


I'm using the Xitami as a personal web server on Windows XP and use this line in my CGI rebol scripts: #! c:\Rebol\View\rebol.exe -cs Note the space after the "#!" and the use of DOS "\". My HTML code (%Test.html) that calls the CGI rebol script looks like this: <html> <body> <form action="http://localhost/cgi-bin/Test.r" method="POST"> <h1>CGI Emailer</h1> <hr> Please enter your email address:<p> <input type="TEXT" name="email" size="30"> <p> <textarea name="message" rows="7" cols="35"> Enter message here. </textarea> <p> <input type="SUBMIT" value="Submit"> </form> </body> </html> My %Test.r script (it's in the CGI-BIN directory) looks like: #! c:\Rebol\View\rebol.exe -cs Rebol [ Name: 'Test Title: "Test" ] print ["Content-Type: text/html^/"] data: make string! 10000 cgi: make object! decode-cgi any [system/options/cgi/query-string ] foreach line any [copy system/ports/input ""] [ repend data [line newline] ] print [ <html><head><title> rebol/script/Title </title></head><body> {Time: } now/time <br> {Here is the posted data:} <hr><pre>data</pre> <hr> {Here is the CGI contents:} <hr> <pre>mold cgi</pre> </body></html> ] And it works from a url like: http://localhost/Test.html So give that a try to see if it works for you. Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [4/9] from: tim::johnsons-web::com at: 2-Jan-2002 12:33


* RStar <[Rich--DogSoldier--com]> [020102 11:50]:
> rebol\core woirks fine on win2k pro and server.
You and I know that. :>) Unfortunately some ISPs are refusing to touch it because of the content I pointed out below. (My personal experience) Tim
> check the shebahg line - might need something like > #!c:/www/rebol/rebol.exe --cgi --script
<<quoted lines omitted: 113>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [5/9] from: louisaturk:eudoramail at: 2-Jan-2002 15:48


Tim, Thanks for the help. I made the registry addition you suggested. My computer is running Personal Web Server and W2K. My ISP is running W2K and IIS I think. But I still can' t get cgi scripts to work on either. Please see my next post. Louis At 11:24 AM 1/2/2002 -0900, you wrote:

 [6/9] from: louisaturk:eudoramail at: 2-Jan-2002 15:54


Tim, Rich, and Mike, My ISP has no objection to me using rebol, and is trying to help me get set up. Here is the script I am trying to get to work (right out of the user's guide, page 12-52): #!c:/rebol/rebol --cgi --script REBOL[] print "Content-Type: text/html^/^/" count: either exists? %counter.txt [load %counter.txt] [0] save %counter.txt count: count + 1 print [{<html><body><h2>Web Count Page</h2>You Are Visitor} count {to this page!<p></body></html>}] This is the error message being returned: HTTP 500 - Internal server error Internet Explorer Louis At 02:41 PM 1/2/2002 -0600, you wrote:

 [7/9] from: al:bri:xtra at: 3-Jan-2002 11:16


Louis wrote:
> print "Content-Type: text/html^/^/"
There only needs to be one "^/" at the end. But that's only a minor problem. I think your problem is here:
> #!c:/rebol/rebol --cgi --script
I believe using "/" is for Unix style scripts. Try using "\" instead. I hope that helps! Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [8/9] from: tim:johnsons-web at: 2-Jan-2002 13:40


* Andrew Martin <[Al--Bri--xtra--co--nz]> [020102 13:33]:
> Louis wrote: > > print "Content-Type: text/html^/^/" > > There only needs to be one "^/" at the end. But that's only a minor problem. > I think your problem is here:
Yes. 'print inserts one newline automatically. When I was running CGI scripts on PWS/Win98, I wasn't modifying my "pound-bang" line (it was configured for Linux remote server). I don't think that PWS cared. My suggestion is to first make this as simple as possible: try print "Content-Type: text/html^/^/" print "HELLO FROM CGI" eliminate all other code, no matter how trivial it may seem. Do you have access to error logs? Can't remember if there are any on Windows. And I presume that you have tested this code directly from the command line. Also, where are you running the script from ... what folder? Have you tested some like http://localhost to confirm that PWS is actually working? HTH tim
> > #!c:/rebol/rebol --cgi --script > I believe using "/" is for Unix style scripts. Try using "\" instead.
<<quoted lines omitted: 6>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [9/9] from: louisaturk:eudoramail at: 2-Jan-2002 20:30


-- Unable to decode HTML file!! --

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted