[REBOL] cgi question
Hi all, (REBOL on FreeBSD and Linux) I can send mail to the two obscured email addresses in the script below from REBOL command w/o any problems. The send/header below however always fails. Anything obvious this newbie might be doing wrong? How can I test what exactly the problem is if not obvious to you gurus? Thanks as always for all help!! Kai REBOL [] response: test recipient1: [EMAIL PROTECTED] recipient2: [EMAIL PROTECTED] header: make system/standard/email [ To: [ recipient1 ] From: [ [EMAIL PROTECTED] ] Subject: subject Organization: organization ] either error? try [ send/header reduce[ recipient1 recipient2 ] response header] [ web-response: { NOT ok! } write/append %errorlog.txt response ] [ web-response: { ok } ] print web-response -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie Rebol (CGI) questions
Kai Peters wrote: Hi All ~ From the web tutorials I have doctored the script below together which leaves me with three questions: 1) Why do I receive an error if i omit the print line immediately after the REBOL [] header? you should not receive an error? I don't understand exactly what do you mean though. As for cgi mode, you have to print that Content/type. line for your browser to be set to right mode ... 2) How can I insert LFs in the line emit [ mold var mold value ] to make the mail more readable? easily put newline there rejoin [value newline value newline] 3) How can i do the set-net stuff permanently? into user.r? I just don't remember exactly, where is rebol looking for it. It will be either your cgi-bin dir, or rebol executable location dir -pekr- Thanks again for any help! Kai -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie Rebol (CGI) questions
Hi, Kai, From: Kai Peters KP From the web tutorials I have doctored the script below KP together which leaves me with three questions: KP 1) Why do I receive an error if i omit the print line KP immediately after the REBOL [] header? The web HTTP protocol requires that the web server return a designation for the type of content that is to be sent, and that this designation shall be followed by a blank line before any content is actually sent. The CGI script may be designed to handle form input, but in a way of speaking, its responsibility is to return something to the browser. Hence the Content-type: text/html which is the usual html web type. As an aside, notice that this line ends with a escaped newline character ^/. The print command supplies one newline and a second must be supplied inorder for there the be a blank line following this line. KP 2) How can I insert LFs in the line KP emit [ mold var mold value ] KP to make the mail more readable? This emit function is one of the language designer's favorite methods for forming large strings from static text, variables, etc. However, I suspect it may be causing confusion for you where the answer might otherwise be obvious. Using a more linear method makes it more obvious how to manage the formatting of strings: ;create a decent size string in order to save ; time having to grow it later response: make string! 2000 ; skip code for brevity ;... foreach [var value] decode-cgi read-cgi [ append response var append response = append response value append response newline ] which can be shortened to: response: make string! 2000 ;... foreach [var value] decode-cgi read-cgi [ append response reduce [var = value newline] ] Since the variables are in a block, REBOL needs to know to substitute their values, which is the purpose of the 'reduce command. This can be further shortened to: response: make string! 2000 ;... foreach [var value] decode-cgi read-cgi [ repend response [var = value newline] ] in which the reduction occurs within the repend command. At this juncture, you will more readily recognize the emit function. KP 3) How can i do the set-net stuff permanently? Place a user.r file with the requisite 'set-net command in the executable directory. This essentially just reads the same exact command in before presenting REBOL's command line. By the way, before sending your email through the CGI interface, you may wish to add two things. First add a first line that will then become the subject for the email message, like: response: rejoin [[somedom.com form] sent: now newline response] This makes it easy to spot mail that comes from your website form system. Second, send the user some feedback that the information was taken and that they can expect a response back, like: header: make system/standard/email [ To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Subject: Message with a header Organization: Super Org ] either error? [send/header [EMAIL PROTECTED] response header][ web-response: {There has been an error in processing your information. While the error has been logged, you may wish to resubmit this information if you have not heard back within 48 hours.} write/append %/path/to/web/error/log/log.txt response ][ web-response: {Thank you for submitting this information. Your response will be processed, and you should receive an answer within 48 hours.} ] print web-response Hope this helps demystify the REBOL way of managing CGI form data. --Scott Jones -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Re: Newbie Rebol (CGI) questions - correction
Forgot the 'try command: header: make system/standard/email [ To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Subject: Message with a header Organization: Super Org ] either error? try [send/header [EMAIL PROTECTED] response header][ web-response: {There has been an error in processing your information. While the error has been logged, you may wish to resubmit this information if you have not heard back within 48 hours.} write/append %/path/to/web/error/log/log.txt response ][ web-response: {Thank you for submitting this information. Your response will be processed, and you should receive an answer within 48 hours.} ] print web-response --Scott Jones -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] Newbie Rebol (CGI) questions
Hi All ~ From the web tutorials I have doctored the script below together which leaves me with three questions: 1) Why do I receive an error if i omit the print line immediately after the REBOL [] header? 2) How can I insert LFs in the line emit [ mold var mold value ] to make the mail more readable? 3) How can i do the set-net stuff permanently? Thanks again for any help! Kai #! /usr/local/bin/rebol -cs REBOL [] print Content-type: text/html^/ response: make string! 2000 emit: func [data] [repend response data] read-cgi: func [ /local data buffer ][ switch system/options/cgi/request-method [ POST [ data: make string! 1020 buffer: make string! 16380 while [positive? read-io system/ports/input buffer 16380][ append data buffer clear buffer ] ] GET [data: system/options/cgi/query-string] ] data ] foreach [var value] decode-cgi read-cgi [ emit [ mold var mold value ] ] set-net[ [EMAIL PROTECTED] smtp.telus.net ] header: make system/standard/email [ To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Subject: Message with a header Organization: Super Org ] send/header [EMAIL PROTECTED] response header -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] [CGI] Re: downloading files with CGI
Carlos: How do I use REBOL to write a CGI script that builds a page with a download link? Simply version: you just need a href to the file that you want downloaded. Take a look at the source of: http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-librarian.r The click here to download the alpha version is simply a link to the file that will be downloaded. This may not be what you want, and it can cause problems with browsers have trouble with downloading files that contain HTML. (That may be because the server or browser is sending/assuming a content-type: text/html). The Script Library also uses another method (I've been experimenting with various things, and the experiments are not at an end) to download a file that may not exist until you click the link. Take a look at: http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=patch-ftp-226-handling.r That has links to Download documentation as: [HTML] or [editable]. Those files probably don't exist until you click the link. The link is to a program. That program creates the file and then sends a HTTP redirect to point your browser at the file it has created: print join Location: http://www.rebol.org/library/docs-download/patch-ftp-226-handling.r print ^/ ;; newline to end HTTP headers Sunanda. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] CGI with REBOL on FREE Web Hosting Services
Hello people I appreciate some suggestions of FREE web hosting services where I could use CGI with REBOL Thanks Carlos -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] CGI session variables like in PHP
Hello list, I'm just thinking about wich is the best way to handle persistent words between HTML pages such as PHP does with its session variables. Any thoughts? TIA Carlos -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] cgi binary data xfer...
hi all, I was wondering how I can provide a link on one page something like: a href/cgi-bin/downloads.cgi?file=test.r and in the downloads.cgi rebol script (after extracting the cgi data), do: print read/binary file-to-xfer - specific questions include: Q1: how do I initiate a binary xfer in cgi/html, so that instead of displaying binary data as a lump of text in the browser, I get a file transfer dialog. Q2: how do I make 'print work like a write/binary so that the read data actually stays binary... thanks in advance! -max PS: I'll give you one guess as for what site this is for... ;-) --- Steel project coordinator http://www.rebol.it/~steel - -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] CGI POST Protocol
Hi, I have already looked at the docs and example scripts but I have not found anything that can help me. I would like to know a way to send data to a web-server as if it received it from a normal page with a form and using the POST protocol. In detail, I want to skip a front page asking for a password interactively by sending the needed data to the web-server directly through REBOL and so obtaining directly the second protected page. Is it possible (is everything possible? 8) ), and how? Thanks in advance MF -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
[REBOL] CGI directory access questions
Rebol CGI Permissions 101 I guess.. I can now upload files happily via http, using Andreas' multipart/form script. But still need help understanding how basic file and directory permissions work from rebol CGI. Example: When I login and run my %testupdir.r script from the bash shell it works OK: -- #!/home/rebol/rebol -cs REBOL [] print Content-type: text/html^/^/ message: hello testing writing to a directory via cgi script append message rejoin [newline read %.now/time] updir: %uploads/ filename: %testupdir.txt filepath: join updir filename write filepath message ; does not work from CGI ;write filename message ; works from CGI quit -- Login and then running script manually from REBOL shell works too, but I get security prompt: now == 4-Sep-2002/18:44:08-4:00 do %testupdir.r REBOL - Security Check: Script requests permission to open a port for read/write on: /web/turbulence/www/Works/trees/vanilla/uploads/testupdir.txt Yes, allow all, no, or quit? (Y/A/N/Q) Y read %uploads/testupdir.txt == {hello testing writing to a directory via cgi script 18:44:27longpath} BUT, when I call it as CGI directly in a browser url, it returns this error: ** Access Error: Cannot open /web/turbulence/www/Works/trees/vanilla/uploads/testupdir.txt ** Where: do-boot ** Near: write filepath message However, if I change script above instead to write into the current directory, then its OK! Q1: What do I need to do to so my script has permissions to run from CGI and read/write into a subdirectory? Q2: Why does it work ok as bash shell executable, but needs manual confirmation in REBOL shell. Q3: What options are there for controlling these permissions? Q4: What checks can I run in rebol CGI scripts to check permission first for directories = create, read, or write thanks ./Jason -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Wiki in Rebol, CGI Xitami
From: Andrew Martin But like every second language learning, the best start is true immersion and for REBOL I am in the bath up to the neck for the moment ... I'm just waiting for the shout of Eureka! :) Or, Ukiah!!! ;-) --Scott Jones -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Wiki in Rebol, CGI Xitami
Hello Andrew, did you already managed for a complete Wiki setup I could test with my browser - with you permission of course? Currently, I'm still testing and refining the Wiki script, and the supporting ML and eText dialects. There's frequent updates on my Web_Dialect at YahooGroups list at: [EMAIL PROTECTED] [EMAIL PROTECTED] or by browser at: http://groups.yahoo.com/group/Web_Dialect You're welcome to subscribe and use the updates and make suggestions as you wish there. I've sent an invite. Others are welcome to subscribe as well. [Date and Author ID Stamping] Currently my Wiki code doesn't have this. It uses a plain text file to store each page, and uses a backup file to hold older versions. The script is intended to be eventually used in a school environment, perhaps accessible by students as well. I'm interested in your thoughts on this subject. [Testing] If you could test the script as well, that would be great. That way we can more quickly find the problems in it and then get them fixed. Andrew Martin ICQ: 26227169 http://valley.150m.com/ -- - Original Message - From: Gerard Cote [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 05, 2002 2:59 AM Subject: [REBOL] Re: Wiki in Rebol, CGI Xitami Hello Andrew, did you already managed for a complete Wiki setup I could test with my browser - with you permission of course? I also planned to do one by myself when I began to learn REBOL a couple of months ago but you got me well before the finish line. In a tentative to accelerate things, I also began my study by looking at the Vanilla-SBX code from Christian Langreiter but I found it too much advanced for me - for the moment. In the same time as I want to be functional quickly, I am installing something that looks like the original Wiki but to which someone added a date and author ID stamping for each entry via the RCS package. As you are probably aware of, this feature is for making the management of the non desired entries an easier task, when necessary. In fact I plan to use it as a tool to support my students during my CS teaching. This is why I need the stamping process and I am sure you understand since I followed the last entries in your OSCAR forum on the Yahoogroups site !!! Do you also plan to include some date and author ID stamping too later if and when you will be ready to do so ? Well may be I could help you in some way - even if for now this is only for testing and commenting purposes ... Thank you for the code. This too will become another study matter in my REBOL quest ! Regards, Gerard -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Wiki in Rebol, CGI Xitami
Hi Andrew, everything is OK in your message sequencing. Thank you for your invitation to join the Web Dialect group. I gratefully accepted your invitation and just began to read the first 6 messages and this seems very promising. Hope I will be not too late when coming to the 400th one or so... since I also have to review at least as much material in four other REBOL related mailing lists while reading and trying many of the exercices proposed in REBOL for Dummies. I even admit that momentarily I had to give up my cover to cover reading of my two other books REBOL programmation and REBOL the Official guide. Add to all this to my current readings extracts coming from the REBOL related web and REB sites (Via View), like REBOL Forces, rebol.com, rebol.org, reboltech and other third parties contributions (Vanilla, REBOL France, etc...), and this is really smelling REBOL a lot here around me ... But like every second language learning, the best start is true immersion and for REBOL I am in the bath up to the neck for the moment ... a chance I don't presently work at all so I can take a full time charge on alterning REBOL learning and doing outside sports !!! I like REBOL more and more as each new day comes to light and I hope to begin programming real useful apps in a near future. Thanks again for your help, Gerard - Original Message - From: Andrew Martin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 05, 2002 5:53 AM Subject: [REBOL] Re: Wiki in Rebol, CGI Xitami There's another update available on my Web_Dialect list. Gerard, let me know if this email reaches you before my earlier reply, and I'll resend it. Andrew Martin ICQ: 26227169 http://valley.150m.com/ -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Wiki in Rebol, CGI Xitami
But like every second language learning, the best start is true immersion and for REBOL I am in the bath up to the neck for the moment ... I'm just waiting for the shout of Eureka! :) Andrew Martin ICQ: 26227169 http://valley.150m.com/ -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Wiki in Rebol, CGI Xitami
Hello Andrew, did you already managed for a complete Wiki setup I could test with my browser - with you permission of course? I also planned to do one by myself when I began to learn REBOL a couple of months ago but you got me well before the finish line. In a tentative to accelerate things, I also began my study by looking at the Vanilla-SBX code from Christian Langreiter but I found it too much advanced for me - for the moment. In the same time as I want to be functional quickly, I am installing something that looks like the original Wiki but to which someone added a date and author ID stamping for each entry via the RCS package. As you are probably aware of, this feature is for making the management of the non desired entries an easier task, when necessary. In fact I plan to use it as a tool to support my students during my CS teaching. This is why I need the stamping process and I am sure you understand since I followed the last entries in your OSCAR forum on the Yahoogroups site !!! Do you also plan to include some date and author ID stamping too later if and when you will be ready to do so ? Well may be I could help you in some way - even if for now this is only for testing and commenting purposes ... Thank you for the code. This too will become another study matter in my REBOL quest ! Regards, Gerard - Original Message - From: Andrew Martin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 03, 2002 3:42 AM Subject: [REBOL] Wiki in Rebol, CGI Xitami Here's my Wiki in Rebol. It runs as a CGI under Xitami's web server, and uses text files to store each page. It uses my %eText.r and %ML.r dialects to change plain text into HTML. Links are expressed like: ?Andrew Martin which links to the file %Andrew Martin.txt. It's not bullet proof, though. Andrew Martin ICQ: 26227169 http://valley.150m.com/ -- -- Attached file included as plaintext by Listar -- -- File: Wiki.r #! C:\Rebol\View\rebol.exe -cs [ Rebol [ Name: 'Wiki Title: Wiki File: %Wiki.r Author: Andrew Martin eMail: [EMAIL PROTECTED] Date: 3/June/2002 ] Directory: %../../Wiki/ Host: %/cgi-bin/ Action: join Host Rebol/script/header/File Forbidden: {\/:*?|} ; A Wiki name cannot contain any of these characters. Permitted: exclude Printable charset Forbidden content-type text/html Bug: function [String [string!]] [Title] [ Title: Wiki Bug! print ML compose/deep [ html [ head [ title (Title) ] body [ h1 (Title) p (String) p [ system/options/cgi/query-string: (mold system/options/cgi/query-string) ] p [Time: (now)] ] ] ] ] Index: has [Title Files Links] [ Files: sort read Directory Title: Index print ML compose/deep [ html [ head [ title (Title) ] body [ h1 (Title) p Pages: ( Links: make block! 4 * length? Files foreach File Files [ if %.txt = find/last File %. [ File: filename File append Links compose/deep [ li [ a/href ( rejoin [Action #? replace/all copy File # %20] ) (File) ] ] ] ] compose/deep [ ul [(Links)] ] ) hr p [As of: (now)] ] ] ] ] if none? Query_String: system/options/cgi/query-string [ ; Might be a POST instead? Post: make string! 2 + Length: to-integer system/options/cgi/content-length read-io system/ports/input Post Length if empty? Post [ Index quit ] Post: decode-cgi Post if all [ parse Post [ set-word! string! set-word! string! end ] Post: make object! Post parse/all Post/File [some Permitted end] ] [ File: to-file Post/File if exists? Backup: rejoin [Directory filename File %.bak] [ delete Backup ] if exists? New_File: join Directory File [ rename New_File Backup ] Text: Post/Text write New_File Text Title: filename File print ML compose/deep [ html [ head [ title (rejoin [{Thanks for editing: } Title {!}]) ] body [ H1 Thank you! p [ Thank you for editing a/href (rejoin [Action #? Title]) (Title) . ] p Your careful attention to detail is much appreciated. p [PS Be sure to b Refresh or b Reload your old pages.] ] ] ] quit ] Bug reform [mold Post] quit ] View: function [Title [string!] File [file!]] [Heading] [ Heading: Title print ML compose/deep [ html [ head [ title (Heading) ] body [ (eText/Wiki/Base read Directory/:File rejoin [Action #?]) hr (now) form/method/action GET (Action) [ input/type/name/value hidden (first Edit_Rule) (Title) input/type/value submit Edit ] ] ] ] ] Verb: :View Edit_Rule: [*Edit #= (Verb: :Edit)] Edit: function [Title [string!] File [file!] /New] [Heading] [ Heading: rejoin [either New [New: ] [Edit: ] Title] print ML compose/deep [ html [ head [ title (Heading) ] body [ h1 (Heading) form/method/action POST (Action) [ input/type/name/value hidden File (File) textarea/name/rows/cols/wrap/style Text 20 80 virtual width:100%; ( either New [ rejoin [ Title newline head insert/dup copy #* length? Title newline ] ] [ read Directory/:File ] ) br input/type/value submit Save
[REBOL] Wiki in Rebol, CGI Xitami
Here's my Wiki in Rebol. It runs as a CGI under Xitami's web server, and uses text files to store each page. It uses my %eText.r and %ML.r dialects to change plain text into HTML. Links are expressed like: ?Andrew Martin which links to the file %Andrew Martin.txt. It's not bullet proof, though. Andrew Martin ICQ: 26227169 http://valley.150m.com/ -- -- Attached file included as plaintext by Listar -- -- File: Wiki.r #! C:\Rebol\View\rebol.exe -cs [ Rebol [ Name: 'Wiki Title: Wiki File: %Wiki.r Author: Andrew Martin eMail: [EMAIL PROTECTED] Date: 3/June/2002 ] Directory: %../../Wiki/ Host: %/cgi-bin/ Action: join Host Rebol/script/header/File Forbidden: {\/:*?|} ; A Wiki name cannot contain any of these characters. Permitted: exclude Printable charset Forbidden content-type text/html Bug: function [String [string!]] [Title] [ Title: Wiki Bug! print ML compose/deep [ html [ head [ title (Title) ] body [ h1 (Title) p (String) p [ system/options/cgi/query-string: (mold system/options/cgi/query-string) ] p [Time: (now)] ] ] ] ] Index: has [Title Files Links] [ Files: sort read Directory Title: Index print ML compose/deep [ html [ head [ title (Title) ] body [ h1 (Title) p Pages: ( Links: make block! 4 * length? Files foreach File Files [ if %.txt = find/last File %. [ File: filename File append Links compose/deep [ li [ a/href ( rejoin [Action #? replace/all copy File # %20] ) (File) ] ] ] ] compose/deep [ ul [(Links)] ] ) hr p [As of: (now)] ] ] ] ] if none? Query_String: system/options/cgi/query-string [; Might be a POST instead? Post: make string! 2 + Length: to-integer system/options/cgi/content-length read-io system/ports/input Post Length if empty? Post [ Index quit ] Post: decode-cgi Post if all [ parse Post [ set-word! string! set-word! string! end ] Post: make object! Post parse/all Post/File [some Permitted end] ] [ File: to-file Post/File if exists? Backup: rejoin [Directory filename File %.bak] [ delete Backup ] if exists? New_File: join Directory File [ rename New_File Backup ] Text: Post/Text write New_File Text Title: filename File print ML compose/deep [ html [ head [ title (rejoin [{Thanks for editing: } Title {!}]) ] body [ H1 Thank you! p [ Thank you for editing a/href (rejoin [Action #? Title]) (Title) .
[REBOL] CGI with Apache under Windows 2000
Hi List, I am testing a little cgi script with Apache. This script is already tested and running fine under Windows 98 and Personal Web Server. Any help would be greatly appreciated : (1) The script (2) The /conf/srm.conf file (3) The error.log Patrick (1) The script 8-- REBOL [] print Content-Type: text/html^/^/ print [ HTML TITLECGI with Rebol/TITLE BODY H1Hello CGI-World!/H1 /BODY /HTML ] 8-- (2) The /conf/srm.conf file 8-- # REBOL section ScriptAlias /cgi-bin/ C:/Apache/cgi-bin/ AddType application/x-httpd-cgi .r 8-- (3) The error.log 8-- [Tue Apr 23 13:51:44 2002] [error] [client 127.0.0.1] c:/apache/cgi-bin/hw-cgi.r is not executable; ensure interpreted scripts have #! first line [Tue Apr 23 13:51:44 2002] [error] [client 127.0.0.1] (2)No such file or directory: couldn't spawn child process: c:/apache/cgi-bin/hw-cgi.r 8-- __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI
Hi, I have been attempting to set up REBOL to do GI for my Webserver (Apache) I keep getting this error in the Apache Error Log: [Wed Apr 10 14:05:14 2002] [error] [client 172.30.8.19] Premature end of script headers: /var/www/cgi-bin/login.r Here is the script in its entirety: #!/usr/lib/rebol/command/rebol -cs REBOL[] print Content-Type:text/plain^/ print testing That is where REBOL is installed on my machine. I have run the script from command line: [root@uno root]# /usr/lib/rebol/command/rebol -cs /var/www/cgi-bin/login.r Content-Type:text/plain testing So what are your suggestions? Thanks!! Ammon -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI Form / Email
Hi, I am working on a cgi form/email program to create a support request form for my company.. So far its going pretty well except i cant figure out how to break the fields apart even more than just from/subject/message... i want them to fill out multiple fields and it list it all in the message... currently my code looks like.. #!rebol -cs REBOL [ Title: Sends Support Request via CGI Form Date: 29-March-2002 File: %cgiemailer.r Purpose: { Uses a Web form to send an support request (email) message. } Category: [cgi email markup net 3] ] supportmail: [EMAIL PROTECTED] system/user/email: [EMAIL PROTECTED] system/schemes/default/host: mail.nex-tekinc.com print Content-Type: text/html^/ ;-- Required Page Header print htmlbodyh2Results:/h2 cgi: make system/standard/email decode-cgi system/options/cgi/query-string either all [ email? try [cgi/email: load cgi/email] ][ print [B Sending Support Request Now/Bbr] send/header [EMAIL PROTECTED] cgi/content cgi ][ print BInvalid email to or from address/B ] print [ Customer Number: B cgi/custnum /BP Email: B cgi/email /BP Name: B cgi/name /BP Problem: B cgi/content /BP ] print /bodyhtml I have the following fields in the webpage.. custnum email name content My goal is to have the customer number appear in the subject, and any other information like name and problem appear in the message body.. I may have more than just these two fields once its all said and done.. Thanks to anyone who can help me out.. Koie Smith [EMAIL PROTECTED] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI mail problems
Hi, I'm using Rebol for a simple CGI script to mail the contents of a form. The problem is that I get the following error after the 'send command: ** User Error: Server error: tcp 250 Bye. ** Where: close smtp-port And this message is append to the emitted web-page so that the user can see it. Any idea what the problem is? The mail works and gets delivered. Robert -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI and Encapsulation
Hello all, Q. Is it possible to have an encapsulated version of Rebol be called via cgi. In other words, can I create a encapsulated version of Rebol that can be distributed for cgi purposes? Thanks T Brownell -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI Weirdness Solved!!!
First of all thank you to my fellow Rebol Netizens for your responses. Petr Krenzelok [EMAIL PROTECTED]'s note about detab'ing got me thinking about what was wrong. I had to FTP the scripts using the ASCII mode (duh!) as opposed to Binary or Auto (which may revert to Binary if not set to understand the .r extension I use.) I realized that I was using a different FTP client (ws_ftp) rather than my usual CuteFTP which I had set to ASCII mode for all my .r files. Hope this helps others who might inadvertently make the same mistake. Thanks again James Nakakihara _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] cgi weirdness
The strange thing is that my old scripts work. I'm using the -cs option that I have used for years. hm. This is really bugging me. Help. Thanks, James Submit: Send Message I don't know why but for some reason I can't get NEW cgi scripts to work properly. I constantly get the REBOL help output listing (you know the one that you get when you ask for help) when I run a cgi program. I've broken it down to the simplist of scripts including one of the sample ones. The strange thing is that my old scripts work. I'm using the -cs option that I have used for years. hm. This is really bugging me. Help. Thanks, James -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] double process for rebol CGI
I'm testing a rebol script on a mac server, but it seems to launch two processes for each request. Is this some setting I have missed, or is this normal behaviour (hope not) ? Here's a script that proved it repeatedly (it happens with all scripts, but I made this one to have more than enough time to du a ps aux): #!/Local/Applications/core024/rebol -cs REBOL [ Title: Wait ] print Content-Type: text/plain^/ print About to wait wait 8 print Finished waiting 8 ...and here are the processes that get launced when I do a request: bash-2.02# ps auxw | grep rebol portal 10965 0.9 0.4 3.98M 2.25M ? S 0:00 rebol -cs? /Local/Library/WebServer/CGI-Executables/wait.r portal 10966 0.0 0.0 2.63M 140K ? S 0:00 rebol -cs? /Local/Library/WebServer/CGI-Executables/wait.r root 10968 0.0 0.1 2.37M 600K p7 S 0:00 grep rebol Can anyone explain? ~H Praetera censeo Carthaginem esse delendam -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Rebol CGI on PWS
Hi Phil, yes, for testing purposes i use the script from the /core documentation. I think it must have something to do with /view installation which makes an .r association during installation. Don't know where to switch it off in Win98! Thorsten Are you using the -cs command line switches ? Phil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thorsten Moeller Sent: 16 October 2001 11:49 To: [EMAIL PROTECTED] Subject: [REBOL] Rebol CGI on PWS Hi, i have a Win98 and PWS running and like to test some Rebol CGI's. The problem i have is that calling the script ends up in an /View-Console Window. Is there something i missed to configure? I have /view and /core installed, but poiting to /core in CGI's first line. Can anybody help or knows a place where i can find some docs? Thorsten -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Rebol CGI on PWS
I think the problem is that Windows interprets all .r files as rebol scripts if they are of type text/plain. Make sure your CGI scripts return Content-type: text/html^/ or something else that cannot be interpreted as plain text. Hope that helps. ~H Du skrev (12.06 17.10.2001): Hi Phil, yes, for testing purposes i use the script from the /core documentation. I think it must have something to do with /view installation which makes an .r association during installation. Don't know where to switch it off in Win98! Thorsten Are you using the -cs command line switches ? Phil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thorsten Moeller Sent: 16 October 2001 11:49 To: [EMAIL PROTECTED] Subject: [REBOL] Rebol CGI on PWS Hi, i have a Win98 and PWS running and like to test some Rebol CGI's. The problem i have is that calling the script ends up in an /View-Console Window. Is there something i missed to configure? I have /view and /core installed, but poiting to /core in CGI's first line. Can anybody help or knows a place where i can find some docs? Thorsten -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. Praetera censeo Carthaginem esse delendam -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Rebol CGI on PWS
Hi Thorsten, to delete the .r association in Windows 98: run explorer.exe, select menu View/Folder Options/File Types, delete REBOL Script from the list. or run regedit.exe, find and delete key HKEY_CLASSES_ROOT\.r Hope this helps, Michal Kracik - Original Message - From: Thorsten Moeller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 17, 2001 12:06 PM Subject: [REBOL] Re: Rebol CGI on PWS Hi Phil, yes, for testing purposes i use the script from the /core documentation. I think it must have something to do with /view installation which makes an .r association during installation. Don't know where to switch it off in Win98! Thorsten Are you using the -cs command line switches ? Phil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thorsten Moeller Sent: 16 October 2001 11:49 To: [EMAIL PROTECTED] Subject: [REBOL] Rebol CGI on PWS Hi, i have a Win98 and PWS running and like to test some Rebol CGI's. The problem i have is that calling the script ends up in an /View-Console Window. Is there something i missed to configure? I have /view and /core installed, but poiting to /core in CGI's first line. Can anybody help or knows a place where i can find some docs? Thorsten -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: double process for rebol CGI
What is the name of the REBOL .r file? John At 08:55 AM 10/17/2001 +0200, you wrote: I'm testing a rebol script on a mac server, but it seems to launch two processes for each request. Is this some setting I have missed, or is this normal behaviour (hope not) ? Here's a script that proved it repeatedly (it happens with all scripts, but I made this one to have more than enough time to du a ps aux): #!/Local/Applications/core024/rebol -cs REBOL [ Title: Wait ] print Content-Type: text/plain^/ print About to wait wait 8 print Finished waiting 8 ...and here are the processes that get launced when I do a request: bash-2.02# ps auxw | grep rebol portal 10965 0.9 0.4 3.98M 2.25M ? S 0:00 rebol -cs? /Local/Library/WebServer/CGI-Executables/wait.r portal 10966 0.0 0.0 2.63M 140K ? S 0:00 rebol -cs? /Local/Library/WebServer/CGI-Executables/wait.r root 10968 0.0 0.1 2.37M 600K p7 S 0:00 grep rebol Can anyone explain? ~H Praetera censeo Carthaginem esse delendam -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Rebol CGI on PWS
Hi, i have a Win98 and PWS running and like to test some Rebol CGI's. The problem i have is that calling the script ends up in an /View-Console Window. Is there something i missed to configure? I have /view and /core installed, but poiting to /core in CGI's first line. Can anybody help or knows a place where i can find some docs? Thorsten -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Rebol CGI on PWS
Are you using the -cs command line switches ? Phil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thorsten Moeller Sent: 16 October 2001 11:49 To: [EMAIL PROTECTED] Subject: [REBOL] Rebol CGI on PWS Hi, i have a Win98 and PWS running and like to test some Rebol CGI's. The problem i have is that calling the script ends up in an /View-Console Window. Is there something i missed to configure? I have /view and /core installed, but poiting to /core in CGI's first line. Can anybody help or knows a place where i can find some docs? Thorsten -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] CGI/Security
The hosting service for my site, provides logs in a html format... I have Rebol routines to parse the data into something more reasonable, but the problem is now that after my site redesign, the average HTML form log is about 300kb in size. Something I feel is a little excessive. I realise I could redesign my site again, but I was hoping to have a CGI script that would read the log compress it and return the compressed results. Which would be something like 20k. Much more useable. My problem then of course is security. How do I get the CGI script to access a web page that requires authorisation? I currently get the logs using a rebol script that reads a CGI page with authorisation. Hoping for a tutorial here or better alternatives. Thanks for your time. Brett. --- http://www.codeconscious.com -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
From: "GS Jones" [EMAIL PROTECTED] From: "Holger Kruse" prin ["Content-Type: text/html" crlf crlf] The HTTP standard requires CRLF as the separator, not just LF. Apache probably does not convert this by itself. I guess that the ^/ is converted to a carriage return linefeed on Windows REBOL, accounting for the difference in platforms. Thanks, Holger. --Scott It just occurred to me that my scripts running on Apache on Solaris have run fine with print "Content-Type: text/html^/" For what its worth, -Scott -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
Still the same problem: ... prin ["Content-Type: text/html" crlf crlf] print { ... and a resulting HTTP request produces (haven't tested it anymore in the browser, because of the result I got through a telnet-test): Date: Wed, 21 Feb 2001 10:23:52 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain /PeO print "Content-Type: text/html^/" Try changing this to prin ["Content-Type: text/html" crlf crlf] The HTTP standard requires CRLF as the separator, not just LF. Apache probably does not convert this by itself. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] outputting HTML from REBOL cgi script
Hi, I got a strange problem while experimenting with REBOL CGI's The problem occurs with both version 2.3 and the latest experimental version of core (2.4.40.1.1) It seems like REBOL is adding its own 'Content-type' header, so that all REBOL CGI script output is text/plain (and therefor is useless for HTML output).. Perl cgi's work fine, so I doubt my server configuration is incorrect. If I telnet to the web server and manually enters the request, I get the following: bash-2.03$ telnet 172.16.0.3 80 Trying 172.16.0.3... Connected to 172.16.0.3. Escape character is '^]'. GET /frida-molle/showpic.cgi?pic=3 HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:29:33 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain HTML HEAD TITLE . ... The first content-type is the one I have in the script, and the second seems to come from REBOL itself. Very minimal script to reproduce the problem: --- #!/usr/local/bin/rebol --cgi REBOL [ Title: "CGI test script" ] print "Content-Type: text/html^/^/" print { HTMLHEADTITLEJust testing/TITLE/HEAD BODY BGCOLOR="white" Just testing, minimal REBOL cgi script /BODY /HTML } --- and the manual HTTP request I send through telnet: GET /frida-molle/test-cgi.cgi HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:38:48 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain ... If I on the other site tries to access a page that do not exist, I get: GET /nonexistant-page.txt HTTP/1.0 HTTP/1.1 404 Not Found Date: Tue, 20 Feb 2001 13:40:30 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Connection: close Content-Type: text/html; charset=iso-8859-1 ... So.. where's the problem ? /PeO -- /* PeO - AMiGA owner since 1990, CGI, Perl, Assembly language HTML-fanatic *\ \* Amiga 4000TE/060-50/604e 200, 146Mb, 33.4Gb, ZIP, JAZ, CVPPC/8 */ /* IIyama VM Pro 21", CP-SW2 Subwoofer system, NEC-222 *\ \* Plextor 12-Plex, Yamaha CRW 4416S, Artec A6000C+, Stylus Color 500*/ /*Lightfax 3660, Catweazel Z-II (3*IDE, 1*PC Floppy), Minolta DImage V *\ \* SCSI-Tower, Seagate Tapestor 4/8GB, Ariadne Ethernet, Minolta PagePro 6 */ -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
Hi, P-O, For what its worth, I tried your minimal test script on my Win98, Apache 1.3.14, RBOL/Core 2.3.0.3.1 local testbed, and it worked fine. So there seems to be some sort of problem more specific to your platform and/or set up. I doubt that this is the problem but only one additional newline is needed, since 'print already supplies one. Again, this won't seem to be the likely cause. Perhaps an Amigan-Apache-REBOLer could test your script. Good luck. --Scott From: "P-O Yliniemi" Hi, I got a strange problem while experimenting with REBOL CGI's The problem occurs with both version 2.3 and the latest experimental version of core (2.4.40.1.1) It seems like REBOL is adding its own 'Content-type' header, so that all REBOL CGI script output is text/plain (and therefor is useless for HTML output).. Perl cgi's work fine, so I doubt my server configuration is incorrect. If I telnet to the web server and manually enters the request, I get the following: bash-2.03$ telnet 172.16.0.3 80 Trying 172.16.0.3... Connected to 172.16.0.3. Escape character is '^]'. GET /frida-molle/showpic.cgi?pic=3 HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:29:33 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain HTML HEAD TITLE . ... The first content-type is the one I have in the script, and the second seems to come from REBOL itself. Very minimal script to reproduce the problem: --- #!/usr/local/bin/rebol --cgi REBOL [ Title: "CGI test script" ] print "Content-Type: text/html^/^/" print { HTMLHEADTITLEJust testing/TITLE/HEAD BODY BGCOLOR="white" Just testing, minimal REBOL cgi script /BODY /HTML } --- and the manual HTTP request I send through telnet: GET /frida-molle/test-cgi.cgi HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:38:48 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain ... If I on the other site tries to access a page that do not exist, I get: GET /nonexistant-page.txt HTTP/1.0 HTTP/1.1 404 Not Found Date: Tue, 20 Feb 2001 13:40:30 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Connection: close Content-Type: text/html; charset=iso-8859-1 ... So.. where's the problem ? /PeO -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
Whoops, I forgot to add the code: snip I doubt that this is the problem but only one additional newline is needed, since 'print already supplies one. --Scott print "Content-Type: text/html^/" is satisfactory instead of: print "Content-Type: text/html^/^/" --Scott -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
Did not make any difference.. I still get double Content-type headers.. A perl script that does exactly the same thing works without problems: --- #!/usr/local/bin/perl print "Content-type: text/html\n\n"; print EOM; HTMLHEADTITLEJust testing/TITLE/HEAD BODY BGCOLOR="white" Just testing, minimal Perl cgi script /BODY /HTML EOM --- .. and is also 3 lines smaller ..and actually.. no extra newlines after the header is enough, since 'print on the next line also gives one.. /PeO Whoops, I forgot to add the code: snip I doubt that this is the problem but only one additional newline is needed, since 'print already supplies one. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
On Tue, Feb 20, 2001 at 07:44:18AM -0600, GS Jones wrote: print "Content-Type: text/html^/" Try changing this to prin ["Content-Type: text/html" crlf crlf] The HTTP standard requires CRLF as the separator, not just LF. Apache probably does not convert this by itself. -- Holger Kruse [EMAIL PROTECTED] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: outputting HTML from REBOL cgi script
From: "Holger Kruse" prin ["Content-Type: text/html" crlf crlf] The HTTP standard requires CRLF as the separator, not just LF. Apache probably does not convert this by itself. I guess that the ^/ is converted to a carriage return linefeed on Windows REBOL, accounting for the difference in platforms. Thanks, Holger. --Scott -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Having trouble getting my rebol cgi setup
I realized that I was less than clear when I talked about restarting Apache. I should have said to restart it after making changes in the httpd.conf file. I suspect you knew that that was what I meant. Yes, not a problem. And, to be sure that I am understanding, is the REBOL script in the cgi-bin directory? And is that where the Perl script is also? I assumed they were. They are. Save the httpd.conf and start/restart Apache. Check your script. If it doesn't work, try the following VERY simple script "clock.r" (or "clock.cgi" if preferred) saved in the cgi-bin directory (which is presumably where the Perl script resides): #!c:/apps/rebol/view/rebol -cs REBOL [Title: "Clock"] print "Content-Type: text/html^/" print ["The time is now" now/time] Good luck and let us know what you find. Will do. I do have Elan's book so I will crack that open as well to see what I'm missing. Thanks, Rod. Rod Gaither Oak Ridge, NC - USA [EMAIL PROTECTED] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Having trouble getting my rebol cgi setup
Hi All, While we are on the subject of CGI I'm having trouble getting my setup to work at home. I am running win2000, Apache, Rebol/View 10.38.3.1 I know the basic cgi stuff is working with win2000/apache since I have run both perl and php scripts so far. For a while I got internal system errors, now after changing the top of my rebol scripts to reference rebol with the full path I get a sending request message that goes on forever. The top of my scripts look like this - #!c:/apps/rebol/view/rebol --cgi I've also edited my httpd.conf file to add an AddType line for .r files. I'm brand new to this so don't make any assumptions that I've done the basics right! :-) Thanks, Rod. Rod Gaither Oak Ridge, NC - USA [EMAIL PROTECTED] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Having trouble getting my rebol cgi setup
Hi, Rod, I run Apache 1.3.14 on Windows 98, so I guess there may be differences given the more secure nature of Win2000. If you are successfully running perl scripts from the cgi-bin directory, then I suspect you basically have done what you need to do. The only additonal factor that readily comes to mind is that most scripts will "violate" REBOL's security, so the security level would need to be changed. Try changing the #! line at the beginning of the script to: #!c:/apps/rebol/view/rebol --cgi --secure or just #!c:/apps/rebol/view/rebol -cs If you are using the #!/path/to/rebol approach, then be sure that this line: #ScriptInterpreterSource registry in the httpd.conf remains commented (meaning that the pound sign is still there). If it still hangs, then be sure that you put: print "Content-Type: text/html^/" before REBOL commands. That way, error messages will generally show up, which can be invaluable in figuring what is wrong. Finally, (and I say this for completeness because you said you were pretty new), be sure to restart Apache. Occasionally, the Windows version won't restart properly (Windows version is still considered beta), so I simply stop it, then start it fresh. If none of this helps, the let us/me know what error message is generated if any. Hope that this helps. --Scott - Original Message - From: "Rod Gaither" Sent: Wednesday, February 07, 2001 2:25 PM Subject: [REBOL] Having trouble getting my rebol cgi setup Hi All, While we are on the subject of CGI I'm having trouble getting my setup to work at home. I am running win2000, Apache, Rebol/View 10.38.3.1 I know the basic cgi stuff is working with win2000/apache since I have run both perl and php scripts so far. For a while I got internal system errors, now after changing the top of my rebol scripts to reference rebol with the full path I get a sending request message that goes on forever. The top of my scripts look like this - #!c:/apps/rebol/view/rebol --cgi I've also edited my httpd.conf file to add an AddType line for .r files. I'm brand new to this so don't make any assumptions that I've done the basics right! :-) Thanks, Rod. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol Cgi Web hosting
Hi, I know this has probably been asked before, but are there any isps out there that allow rebol cgi? Well, if you live in the UK, you could use Mersinet, I got them to install rebol a while ago. http://www.mersinet.co.uk == Or www.netisnet.co.uk They allow you to install rebol.exe in your cgi-bin directory allow telnet access - which always helps :-) Nigel -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol Cgi Web hosting
Thanks everyone for you response. Mersinet looks pretty good but the dial-up costs might be a little to expensive. Hmm dial up from South Carolina, USA to UK wonder how much a multimeg download would cost doing that lol. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Re(2): Rebol Cgi Web hosting
Anton wrote: I've collected the references to rebol friendly sites mentioned in the last couple of days. http://users.bigpond.net.au/datababies/anton/RebolFriendlySites.html Once I have my Unofficial Rebol User and Friendly ISP list working (needs some more html work and a reply from RT about trademark stuff...) can I copy that stuff into the database? And does anyone know if these ISPs have banners (less than 256x80) that can be used for linking to them? Chris -- New sig in the works Explorer2260 Designer and Coder http://www.starforge.co.uk -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Re(2): Rebol Cgi Web hosting
Yeah, it's all free - I mean, no it's all copyright - I'll sue! ;) -Anton. Anton wrote: I've collected the references to rebol friendly sites mentioned in the last couple of days. http://users.bigpond.net.au/datababies/anton/RebolFriendlySites.html Once I have my Unofficial Rebol User and Friendly ISP list working (needs some more html work and a reply from RT about trademark stuff...) can I copy that stuff into the database? And does anyone know if these ISPs have banners (less than 256x80) that can be used for linking to them? Chris -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Re(2): Rebol Cgi Web hosting
Hi, I've collected the references to rebol friendly sites mentioned in the last couple of days. If you want to make your list bigger :), you might want to know that Mersinet is owned by a company called Linix. They also run: http://www.welshnet.co.uk http://www.sitesource.co.uk And loads more, the Rebol support is unofficial, considering the guy that installed it for me has only just left to work elsewhere. == All the best, -- Malcolm Campbell [EMAIL PROTECTED] FreesiteUK - http://www.freesiteuk.com The UK based searchable web directory of free internet services. _ Win a Sony Playstation 2 with FreesiteUK and dooyoo! Enter by visiting: http://www.freesiteuk.com/index.cgi?244724062;INFO (UK residents only) -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol Cgi Web hosting
Hi, Thanks everyone for you response. Mersinet looks pretty good but the dial-up costs might be a little to expensive. Hmm dial up from South Carolina, USA to UK wonder how much a multimeg download would cost doing that lol. Nah, you cannot call it internationally, they use CLI to ensure that no other user attepts to log into your FTP account - which doesn't work internationally (or so I have been told). == All the best, -- Malcolm Campbell [EMAIL PROTECTED] FreesiteUK - http://www.freesiteuk.com The UK based searchable web directory of free internet services. _ Win a Sony Playstation 2 with FreesiteUK and dooyoo! Enter by visiting: http://www.freesiteuk.com/index.cgi?244724062;INFO (UK residents only) -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol Cgi Web hosting
Hi, I know this has probably been asked before, but are there any isps out there that allow rebol cgi? Well, if you live in the UK, you could use Mersinet, I got them to install rebol a while ago. http://www.mersinet.co.uk == All the best, -- Malcolm Campbell [EMAIL PROTECTED] FreesiteUK - http://www.freesiteuk.com The UK based searchable web directory of free internet services. _ Win a Sony Playstation 2 with FreesiteUK and dooyoo! Enter by visiting: http://www.freesiteuk.com/index.cgi?244724062;INFO (UK residents only) -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol Cgi Web hosting
I know this has probably been asked before, but are there any isps out there that allow rebol cgi? If a popup banner window is not a problem for you: http://free.prohosting.com Someone on this list has written a guide how to install and use rebol (bsdi) on their server. But can't remember link now. Jean -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Wanted - Rebol CGI success stories :)
I've seen a number of posts regarding CGI and Rebol most of which related to problems (probably to be expected - people usually want help). I thought it would be good if people with reliable Rebol CGIs could post their successes to this thread (hopefully mentioning the words/phrases reliable, fast, since eons ago, no runaway processes, etc). Any? Thanks Brett. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Antwort: Wanted - Rebol CGI success stories :)
My boss was sceptical ( he loves ASP and all that) but when I showed him my email and bulletin-board script, he was suprised. Nobody notices that REBOL captures data from a form, adds it to a flat file on the server, reads the file, creates a frameset frame and displays the result! I don´t know how the performance would be in a "REAL" internet scenarion since all my scripts have only been tested in an Intranet. REBOL CGI beats writing servlets since they are easier to debug. I would really like to know how much of a resource drain it is when several users call a REBOL script as that is the main advantage of Java servlets of CGI, anyone done research on this? . When I´m up to it ( with help from the excellent REBOL list of course) I would like to try to code some sort of Web-application framework, REBOL webserver inclusive ( see www.enhydra.org, cool! they convert HTML into objects for set/get access) Cheers! Sharriff Aina "Brett Handley" brett@codeconsAn: [EMAIL PROTECTED] cious.com Kopie: Gesendet von: Thema: [REBOL] Wanted - Rebol CGI success stories :) rebol-bounce@re bol.com 21.11.00 11:21 Bitte antworten an rebol-list I've seen a number of posts regarding CGI and Rebol most of which related to problems (probably to be expected - people usually want help). I thought it would be good if people with reliable Rebol CGIs could post their successes to this thread (hopefully mentioning the words/phrases reliable, fast, since eons ago, no runaway processes, etc). Any? Thanks Brett. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Wanted - Rebol CGI success stories :)
Brett Handley wrote: I've seen a number of posts regarding CGI and Rebol most of which related to problems (probably to be expected - people usually want help). I thought it would be good if people with reliable Rebol CGIs could post their successes to this thread (hopefully mentioning the words/phrases reliable, fast, since eons ago, no runaway processes, etc). Any? Sure, I can't do it at the moment as I'm at work, but when I get home tonight I'll make all my tested CGI scripts available for download from my website. That's if I remember of course, one thing does tend to drive out another :)) Chris -- New sig in the works Explorer2260 Designer and Coder http://www.starforge.co.uk -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Wanted - Rebol CGI success stories :)
Thanks very much Chris that would be great if they are not too big. I would certainly like to see them, so if they are a bit big an offlist email? My post wording was ambiguous. I was thinking in terms of statistics how long as your CGI been running - maybe even how many requests. How reliable is it? Brett. - Original Message - From: "Chris" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 10:47 PM Subject: [REBOL] Re: Wanted - Rebol CGI success stories :) Brett Handley wrote: I've seen a number of posts regarding CGI and Rebol most of which related to problems (probably to be expected - people usually want help). I thought it would be good if people with reliable Rebol CGIs could post their successes to this thread (hopefully mentioning the words/phrases reliable, fast, since eons ago, no runaway processes, etc). Any? Sure, I can't do it at the moment as I'm at work, but when I get home tonight I'll make all my tested CGI scripts available for download from my website. That's if I remember of course, one thing does tend to drive out another :)) Chris -- New sig in the works Explorer2260 Designer and Coder http://www.starforge.co.uk -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] CGI security?
I read from the REBOL.com FAQ list that CGI scripts ca be runjust by putting the interpreter in the CGI-BIN directory or another directory designated to run scripts one does not have a CGI-BIN directory. Could this cause a security problem? if its as simple as that is there a need to tell a Web hosting service to install REBOL at all on the server? has anyone tried this out? Sharriff Aina -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: [REBOL]Cgi Script file access problem
Hi, Tim. I'm no Linux or Apache expert myself, but I would guess that it is a permissions problem. Apache is executing your cgi script with the permissions of user "nobody". I bet the directory /home/httpd/cgi-bin does not allow write permissions for anyone but user "httpd". Therefore, when your script attempts to create a file in this directory, it is getting a permissions error. Just a guess. Jamey. On Tuesday 14 November 2000 22:32, you wrote: Hi: Am new to linux and apache. I am running the following script on through apache: ; #!/usr/bin/rebol -cs REBOL[] print "Content-Type: text/html^/^/" debug-port: open/new/write make file! "test.txt" close debug-port running this from rebol command line as do %testcgi.r performs without error message. Running this as a cgi script ie. http://localhost/cgi-bin/testcgi.r returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: debug-port: open/new/write make file! "test.txt" subsitituting write %test.txt "line one" returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: write %test.txt "line one" I'm guessing I need to do something with the apache configuration. Does anyone know what needs to be done? TIA -Tim -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] : CGI HTML TEXTAREAS and wrap attributes
Hi Elan, Tim I found out that either the "Wrap="virtual or wrap="physical" attribute in a TEXTAREA does not transmit Paragraph breaks when sending data over CGI in REBOL, strangely, putting p tags in the TEXTAREA translates truly into paragraphs. Are these attributes not supported in the object "decode-cgi" ? Sharriff Aina med.iq information quality in healthcare AG -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: [REBOL]Cgi Script file access problem
Thanks Jamey, I think you are correct... Now to see how to change that. :) regards -Tim Jamey Cribbs wrote: Hi, Tim. I'm no Linux or Apache expert myself, but I would guess that it is a permissions problem. Apache is executing your cgi script with the permissions of user "nobody". I bet the directory /home/httpd/cgi-bin does not allow write permissions for anyone but user "httpd". Therefore, when your script attempts to create a file in this directory, it is getting a permissions error. Just a guess. Jamey. On Tuesday 14 November 2000 22:32, you wrote: Hi: Am new to linux and apache. I am running the following script on through apache: ; #!/usr/bin/rebol -cs REBOL[] print "Content-Type: text/html^/^/" debug-port: open/new/write make file! "test.txt" close debug-port running this from rebol command line as do %testcgi.r performs without error message. Running this as a cgi script ie. http://localhost/cgi-bin/testcgi.r returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: debug-port: open/new/write make file! "test.txt" subsitituting write %test.txt "line one" returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: write %test.txt "line one" I'm guessing I need to do something with the apache configuration. Does anyone know what needs to be done? TIA -Tim -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: [REBOL]Cgi Script file access problem
Well, I can think of a couple of suggestions: 1). Change the permissions on your /home/httpd/cgi-bin directory to allow write access to all users. However, I would strongly recommend AGAINST this unless this web server is on an intranet that you know is completely secure and you trust all of the people who could access it. The reason is that you are giving anyone the ability to write, delete, change files in that directory. Again, I don't recommend you do this unless you are absolutely sure. But if you do decide to do this, simply login as root and type the following command: chmod o+w /home/httpd/cgi-bin 2). You could change the path in your script to another directory on your linux box that allows write permissions to everybody. That way, you could pick a directory that you don't care if somebody blows it away. That's the only two I can think of off the top of my head. I'm sure some of the gurus who patrol this list will have others! Jamey. On Wednesday 15 November 2000 11:28, you wrote: Thanks Jamey, I think you are correct... Now to see how to change that. :) regards -Tim Jamey Cribbs wrote: Hi, Tim. I'm no Linux or Apache expert myself, but I would guess that it is a permissions problem. Apache is executing your cgi script with the permissions of user "nobody". I bet the directory /home/httpd/cgi-bin does not allow write permissions for anyone but user "httpd". Therefore, when your script attempts to create a file in this directory, it is getting a permissions error. Just a guess. Jamey. On Tuesday 14 November 2000 22:32, you wrote: Hi: Am new to linux and apache. I am running the following script on through apache: ; #!/usr/bin/rebol -cs REBOL[] print "Content-Type: text/html^/^/" debug-port: open/new/write make file! "test.txt" close debug-port running this from rebol command line as do %testcgi.r performs without error message. Running this as a cgi script ie. http://localhost/cgi-bin/testcgi.r returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: debug-port: open/new/write make file! "test.txt" subsitituting write %test.txt "line one" returns the following error message from rebol: ** Access Error: Cannot open /home/httpd/cgi-bin/test.txt. ** Where: write %test.txt "line one" I'm guessing I need to do something with the apache configuration. Does anyone know what needs to be done? TIA -Tim -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] CGI HTML Editor,
Hi all! I have coded a script that takes input from an HTML-form and stores the resulting HTML page on the server. The problem is, my REBOL script just exchanges the text in my Page template and the formatting is totally ruined. The content is readable and looks fine in a browser window of its own, but I´m trying to display this in a frame, and the resulting text does not wrap. I have tried all the HTML text formatting tags and attributes like "WRAP" , int t cell; "TD width="n"" and so on. I just want REBOL to capture a string and give it back without need for reformatting. Has anyone coded something similar? its a VERS simplified sort of HTML editor. Best regards Sharriff Aina med.iq information quality in healthcare AG -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] cgi configuration with apache
I know this has been brought up several dozen times on this list. However I lost my archive due to an "accident" *grin* I was wondering how I setup rebol as a cgi wrapper. (httpd.conf entries and etc..) Jarrett
[REBOL] CGI to frame question
Is there an example of how one can send REBOL CGI output to a particular frame somewhere? can someone give me an example? Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI to frame question Re:
I believe... FORM METHOD=GET ACTION="http://www.domain.dom/cgi-bin/script.cgi" target= "frame1" The target attribute defines the output location for the action. (this is just an educated guess since I've never actually done this myself.) -Ryan Is there an example of how one can send REBOL CGI output to a particular frame somewhere? can someone give me an example?
[REBOL] CGI
Hi guys! Sorry to bother you with this newbie question: Why does one have to "make object!" after a "decode-cgi" ? just curious... Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI Re:(2)
Though, as noted on an earlier message on this list, doing so means that you will only get one value from a multi-select input. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 04, 2000 8:08 PM Subject: [REBOL] CGI Re: Sharriff Aina wrote: Sorry to bother you with this newbie question: Why does one have to "make object!" after a "decode-cgi" ? just curious... Actually, one doesn't have to, but it's safer for your software if you so, as you can put arbitrary Rebol code in the cgi url. Putting the results of the decode-cgi in a object minimises the damage the Rebol code can do. Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ http://members.xoom.com/AndrewMartin/ --
[REBOL] CGI Re:
It simply makes an easy-access object out of the data: decode-cgi "foo=10bar=20" == [foo: 10 bar: 20] when you make an object out of it with: cgi: make object! decode-cgi "foo=10bar=20" you can access the form values like this: cgi/foo == 10 cgi/bar == 20 The reason you might not make an objects is if you have multiple form items on the page with the same name so your cgi query string looks like this: "foo=10bar=20bar=30" Then if you make an object, you'll only get one value for 'bar. WARNING You can also DO the decoded cgi block and it will set the words to their respective valus. This is neat but remember that any word can come in through cgi so if you do this: do decode-cgi "foo=10bar=20read=0" will stomp all over the word 'read... not a good idea. And since you do not have control over what somebody could hack pu and send in to you cgi program it is not generally a good idea to DO the decode-cgi block. WARNING Sterling Hi guys! Sorry to bother you with this newbie question: Why does one have to "make object!" after a "decode-cgi" ? just curious... Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI parse and save problem!
HELP! I´m trying to capture values from a web page with a Rebol CGI script. I would like to append the values in a directory on the web sever as ablock. The problem is, some of the values have quotes. Values form HTML : value1 "one" value2 "two" value3 "three" to be save to-- %value-list.r as: value-list: [ existing- value: [ exvalue1 "exone" exvalue2 "extwo" exvalue3 "three" ] ;existing values in pseudo database new-values: [ value1 "one" value2 "two" value "three" ] ;new values appended from CGI script ] Please help! Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI, Security mod off
Hi Rebelists! can some one help me with my CGI problems? I can´t get them to run without REBOL asking for READ/WRITE access. I have tried using REBOL -cs. Do I have formulate the REBOL call to " REBOL -cs %s" ? or something of the sort? I am using Win98 with the XITAMI webserver ( Core 2.3 ) Best regards Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI, Security mod off
Hi Sharriff can some one help me with my CGI problems? I can´t get them to run without REBOL asking for READ/WRITE access. I have tried using REBOL -cs. Do I have formulate the REBOL call to " REBOL -cs %s" ? or something of the sort? I am using Win98 with the XITAMI webserver ( Core 2.3 ) Insert following line after the header SECURE none I hope that works. Andreas -- Andreas Drehmann DELMIA GmbH Fellbacher Strasse 115 D-70736 Fellbach, Germany eMail: [EMAIL PROTECTED] --
[REBOL] Rebol CGI scripts on XITAMI Webserver.
Hi Rebolers! Does anybody have any experience running rebol scripts on the XITAMI web server? I can´ t get the scripts to run without asking for Read/write access rights. I´ve tried " c:\rebol\rebol.exe -cs e.t.c from the users guide from the web site. Further more can some one point me to a good tutorial or explain File addressing to me? I have a problem calling files or scripts from different directories. Best regards Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] CGI setup Re:
I've managed to do it. But unfortunately I'm at the wrong 'puter atm. You should add a registry key to map .r cgi's to Rebol though. ;) /regards Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: den 18 september 2000 07:44 To: [EMAIL PROTECTED] Subject: [REBOL] CGI setup does anyone know how to setup MS PWS with rebol for cgi in windows95/98 i have n idea. aden.
[REBOL] CGI setup Re:(2)
At the following link you can find an edited message on this subject. Note that it assumes that you are familiar with changing the registry. http://www.codeconscious.com/rebol/rebol-net.html#UsingRebolCGIwithPersonalW ebServer Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 18, 2000 5:15 PM Subject: [REBOL] CGI setup Re: I've managed to do it. But unfortunately I'm at the wrong 'puter atm. You should add a registry key to map .r cgi's to Rebol though. ;) /regards Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: den 18 september 2000 07:44 To: [EMAIL PROTECTED] Subject: [REBOL] CGI setup does anyone know how to setup MS PWS with rebol for cgi in windows95/98 i have n idea. aden.
[REBOL] CGI setup Re:
Hi: Add a new string value to : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script Map with name of .r (this is the suffix for the rebol script) and data value of c:\rebol\rebol.exe -cs %s (obviously substitute the appropriate path to your executable). This works for me on Win NT 4.0 sp6. You may try you scripts in both cgi-bin and /scripts folder. In my case I can run cgi scripts from the cgi-bin directory and all the folders below that path. -Tim [EMAIL PROTECTED] wrote: does anyone know how to setup MS PWS with rebol for cgi in windows95/98 i have n idea. aden.
[REBOL] CGI setup
does anyone know how to setup MS PWS with rebol for cgi in windows95/98 i have n idea. aden.
[REBOL] CGI: debug mode Re:
Hello, I've seen it in a lot of CGI Rebol scripts: place the 'print "Content-type: text/html"' first. I don't like it myself, but I use it sometimes when I run into trouble, until the script is fully tested, then I put it in place again. Regards, Rachid - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 31, 2000 15:22 Subject: [REBOL] CGI: debug mode - Open Your Mind - [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE ON ]]] I've been going mad due to a malfunctioning CGI script. It wouldn't even tell me what the error was, I just got a generic error page. I've spent many hours trying to understand what the problem was, then I used a dirty trick (I simulated its execution *by hand*) and found out that the Content-Type wasn't being issued because there was a loading-time error, so even the very first instruction ( print "Content-Type: text/plain^/" ) wasn't executed. This happened online only, the offline execution was OK. Argh. Now the problem's solved, but it would be nice'n'useful to have a command line option to make sure that, in case *anything* gets written to standard output, the very first thing printed is "Content-Type: text/plain^/" or some other Content-Type. Now, if the script issues "Content-Type: text/plain^/" itself, that's OK, if the script issues "Content-Type: text/html^/" that's OK, if the script issues "Content-Type: movie/sci-fi^/", that's OK... but if the script issues anything else or if there's an early error, the REBOL interpreter issues "Content-Type: text/plain^/" *first*. So we can see what the hell's going on. :-) I realize this would bring performance down a bit, so it should be a separate, non-default choice. I was thinking something like --cgidebug or -d, like this: REBOL --cgidebug --secure none cgi-script.r REBOL -ds cgi-script.r Or at least have "Content-Type: text/plain^/" printed before any early error message when using the standard --cgi ((-: [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE OFF ]]] Alessandro Pini ([EMAIL PROTECTED]) "Dave, about that monolith..." "Yes, HAL?" "Have you tried the switch?" (-O HAL 9000 Bowman :-)
[REBOL] CGI: debug mode Re:(3)
From: [EMAIL PROTECTED] I do, too (during the debug phase, then I comment it away), but you may have missed the point: Yes, that went one went over my head completely! Sorry! ;o) Regards, Rachid
[REBOL] CGI: debug mode
- Open Your Mind - [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE ON ]]] I've been going mad due to a malfunctioning CGI script. It wouldn't even tell me what the error was, I just got a generic error page. I've spent many hours trying to understand what the problem was, then I used a dirty trick (I simulated its execution *by hand*) and found out that the Content-Type wasn't being issued because there was a loading-time error, so even the very first instruction ( print "Content-Type: text/plain^/" ) wasn't executed. This happened online only, the offline execution was OK. Argh. Now the problem's solved, but it would be nice'n'useful to have a command line option to make sure that, in case *anything* gets written to standard output, the very first thing printed is "Content-Type: text/plain^/" or some other Content-Type. Now, if the script issues "Content-Type: text/plain^/" itself, that's OK, if the script issues "Content-Type: text/html^/" that's OK, if the script issues "Content-Type: movie/sci-fi^/", that's OK... but if the script issues anything else or if there's an early error, the REBOL interpreter issues "Content-Type: text/plain^/" *first*. So we can see what the hell's going on. :-) I realize this would bring performance down a bit, so it should be a separate, non-default choice. I was thinking something like --cgidebug or -d, like this: REBOL --cgidebug --secure none cgi-script.r REBOL -ds cgi-script.r Or at least have "Content-Type: text/plain^/" printed before any early error message when using the standard --cgi ((-: [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE OFF ]]] Alessandro Pini ([EMAIL PROTECTED]) "Dave, about that monolith..." "Yes, HAL?" "Have you tried the switch?" (-O HAL 9000 Bowman :-)
[REBOL] CGI: debug mode Re:
Hi Alex: I'm a rebol newbie, but have done a lot of CGI programming, and have had to resolve a lot of headaches myself. One of the things that I do is build in switches to send my content to a physical file if necessary. Often times that is helpful, other times, one may actually want to build static pages with the same code. see http://www.rebolforces.com/cgi-util.html also http://www.rebolforces.com/cgi-basics.html and http://www.rebolforces.com/ good stuff there You will find redundant and sloppy code in cgi-util because I am very new to rebol, but some useful stuff, I hope. Look for functionality around re-direction of output. Your comments, questions, and criticisms will be appreciated. They will make me a better rebol programmer. You may email me directly if you wish. regards Tim [EMAIL PROTECTED] wrote: - Open Your Mind - [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE ON ]]] I've been going mad due to a malfunctioning CGI script. It wouldn't even tell me what the error was, I just got a generic error page. I've spent many hours trying to understand what the problem was, then I used a dirty trick (I simulated its execution *by hand*) and found out that the Content-Type wasn't being issued because there was a loading-time error, so even the very first instruction ( print "Content-Type: text/plain^/" ) wasn't executed. This happened online only, the offline execution was OK. Argh. Now the problem's solved, but it would be nice'n'useful to have a command line option to make sure that, in case *anything* gets written to standard output, the very first thing printed is "Content-Type: text/plain^/" or some other Content-Type. Now, if the script issues "Content-Type: text/plain^/" itself, that's OK, if the script issues "Content-Type: text/html^/" that's OK, if the script issues "Content-Type: movie/sci-fi^/", that's OK... but if the script issues anything else or if there's an early error, the REBOL interpreter issues "Content-Type: text/plain^/" *first*. So we can see what the hell's going on. :-) I realize this would bring performance down a bit, so it should be a separate, non-default choice. I was thinking something like --cgidebug or -d, like this: REBOL --cgidebug --secure none cgi-script.r REBOL -ds cgi-script.r Or at least have "Content-Type: text/plain^/" printed before any early error message when using the standard --cgi ((-: [[[ MY-MESSAGES-TO-FEEDBACK-KEEP-BOUNCING-BACK MODE OFF ]]] Alessandro Pini ([EMAIL PROTECTED]) "Dave, about that monolith..." "Yes, HAL?" "Have you tried the switch?" (-O HAL 9000 Bowman :-)
[REBOL] CGI: reading POST-method data with read-io Re:(6)
On Fri, Aug 25, 2000 at 04:51:17PM -0800, [EMAIL PROTECTED] wrote: Hello: When Holger speaks, I pay attention. I have the following line of code for reading POST input from CGI as follows: ;=== either tmp 0 [ buffer: make string! (tmp + 10) ; allocate storage space while [tmp 0] ; and read ; I think Holger suggests this is not good: [tmp: tmp - read-io system/ports/input buffer tmp] return buffer ] What would be a safe alternative, please? For stdin/out you may still have to use read-io to be fully interoperable across platforms. That's because REBOL does not yet fully support non-socket streams at the port level, e.g. within a 'wait block. That is likely to change in the future though. My point about not using read-io mostly refered to TCP streams. -- Holger Kruse [EMAIL PROTECTED]
[REBOL] CGI: reading POST-method data with read-io Re:(4)
On Fri, Aug 25, 2000 at 08:03:31PM +0200, [EMAIL PROTECTED] wrote: Hello [EMAIL PROTECTED]! You need to use READ-IO when you a) want the raw data and b) don't want to wait for the remote part to close the port. COPY/PART had a similar functionality on /BINARY TCP ports, but it still waited if there were no data in the port. Now you can just use COPY or COPY/PART, because it no more waits for data. Please wait for the next experimental build (i.e. a version AFTER Core 2.4.34, View 0.10.25 or Command 0.6.12) before publically releasing any scripts that use the new non-blocking features in REBOL, because we need to change the behavior (again), for better compatibility with older scripts, and to avoid future legacy problems, This change will break scripts that rely on the behavior in the current exp-build. The changes are: copy on TCP ports opened without refinements will work the way it used to originally (i.e. block if there is no data). If you don't want copy to block then use /no-wait on the open call. This means instead of a /wait refinement there will be a /no-wait refinement, and the default behavior will be reversed compared to the current exp-build, and thus will be the same way it used to be in Core = 2.3 (blocking). The main reason is that with this change scripts which loop on copy until it returns none will continue to work on new versions of REBOL, without adapting the script. Also, if there is no data then copy will return an empty series, not none, as it does in current exp-builds, allowing you to distinguish the "no data available yet, would block" case from an end of stream, i.e. the peer closing the connection (for which copy will still return none). There will also be some changes to wait to make it more useful, e.g. wait [0 port] will poll the port (i.e. return the port if there is data, and none otherwise). This also works with multiple ports. Old versions of Core already used to do this on some platforms, somewhat inofficially, but current versions don't. It will become an official feature on all platforms starting with the next experimental build. There will also be a new "/all" refinement to wait which causes wait to return a block of all ports that have data waiting (instead of returning just one port). This allows you to write your own scheduler (e.g. round-robin) for handling incoming data on a multiplexed server written in REBOL. We are also planning other enhancements to wait and ports in general in the future, to make it easier to handle interactive, asynchronous connections, to support asynchronous sending, asynchronous connecting, asynchronous accepting of connections, asynchronous UDP operation, and to simplify the handling of multiple connections at the same time, e.g. for downloads in the background and for multiplexed web/ftp servers. Lots of good stuff ahead :). Please avoid using read-io whenever possible. It is a very low-level function that exposes your script to operating system-dependent oddities. For instance the amount of data typically returned may vary with the operating system, making testing more difficult for you. You also lose the convenience of line feed conversion etc., which may cause unexpected problems with your script when moving between Windows and Unix machines. "Normal" port functions in REBOL (copy, insert etc.) do these things automatically for you. We realize that in the past some shortcomings in the "normal" port functions (in particular copy blocking) have prevented you from doing some useful things, and sometimes read-io seemed to help, but these issues should be resolved in the next exp builds, and then the use of read-io will be discouraged even more than it is now. And just in case you are wondering, those new port features together with work on some additional enhancements in VID are the reasons why the new exp build for View we promised earlier is not out yet -- sorry for that delay. RSN, really... -- Holger Kruse [EMAIL PROTECTED]
[REBOL] CGI: reading POST-method data with read-io Re:(5)
Expletives of Joy!! I must say that I am extremely delighted! You guys are right on the bulls-eye!!! This is the kind of excellence Rebol Tech is famous for! These are just what we needed, and well thought out, too! Hip hip hooray!!! -Galt p.s. Could we also get more than 63 ports per process on Windows? Would help when you are doing a http or proxy server or load-tester. Seriously, I already have a bitchin rebol app that works, but it hits that limit! Real servers have hundreds or thousands of conns going. = Original Message From [EMAIL PROTECTED] = On Fri, Aug 25, 2000 at 08:03:31PM +0200, [EMAIL PROTECTED] wrote: Hello [EMAIL PROTECTED]! You need to use READ-IO when you a) want the raw data and b) don't want to wait for the remote part to close the port. COPY/PART had a similar functionality on /BINARY TCP ports, but it still waited if there were no data in the port. Now you can just use COPY or COPY/PART, because it no more waits for data. Please wait for the next experimental build (i.e. a version AFTER Core 2.4.34, View 0.10.25 or Command 0.6.12) before publically releasing any scripts that use the new non-blocking features in REBOL, because we need to change the behavior (again), for better compatibility with older scripts, and to avoid future legacy problems, This change will break scripts that rely on the behavior in the current exp-build. The changes are: copy on TCP ports opened without refinements will work the way it used to originally (i.e. block if there is no data). If you don't want copy to block then use /no-wait on the open call. This means instead of a /wait refinement there will be a /no-wait refinement, and the default behavior will be reversed compared to the current exp-build, and thus will be the same way it used to be in Core = 2.3 (blocking). The main reason is that with this change scripts which loop on copy until it returns none will continue to work on new versions of REBOL, without adapting the script. Also, if there is no data then copy will return an empty series, not none, as it does in current exp-builds, allowing you to distinguish the "no data available yet, would block" case from an end of stream, i.e. the peer closing the connection (for which copy will still return none). There will also be some changes to wait to make it more useful, e.g. wait [0 port] will poll the port (i.e. return the port if there is data, and none otherwise). This also works with multiple ports. Old versions of Core already used to do this on some platforms, somewhat inofficially, but current versions don't. It will become an official feature on all platforms starting with the next experimental build. There will also be a new "/all" refinement to wait which causes wait to return a block of all ports that have data waiting (instead of returning just one port). This allows you to write your own scheduler (e.g. round-robin) for handling incoming data on a multiplexed server written in REBOL. We are also planning other enhancements to wait and ports in general in the future, to make it easier to handle interactive, asynchronous connections, to support asynchronous sending, asynchronous connecting, asynchronous accepting of connections, asynchronous UDP operation, and to simplify the handling of multiple connections at the same time, e.g. for downloads in the background and for multiplexed web/ftp servers. Lots of good stuff ahead :). Please avoid using read-io whenever possible. It is a very low-level function that exposes your script to operating system-dependent oddities. For instance the amount of data typically returned may vary with the operating system, making testing more difficult for you. You also lose the convenience of line feed conversion etc., which may cause unexpected problems with your script when moving between Windows and Unix machines. "Normal" port functions in REBOL (copy, insert etc.) do these things automatically for you. We realize that in the past some shortcomings in the "normal" port functions (in particular copy blocking) have prevented you from doing some useful things, and sometimes read-io seemed to help, but these issues should be resolved in the next exp builds, and then the use of read-io will be discouraged even more than it is now. And just in case you are wondering, those new port features together with work on some additional enhancements in VID are the reasons why the new exp build for View we promised earlier is not out yet -- sorry for that delay. RSN, really... -- Holger Kruse [EMAIL PROTECTED]
[REBOL] CGI: reading POST-method data with read-io Re:(5)
Hello: When Holger speaks, I pay attention. I have the following line of code for reading POST input from CGI as follows: ;=== either tmp 0 [ buffer: make string! (tmp + 10) ; allocate storage space while [tmp 0] ; and read ; I think Holger suggests this is not good: [tmp: tmp - read-io system/ports/input buffer tmp] return buffer ] What would be a safe alternative, please? TIA -Tim [EMAIL PROTECTED] wrote: Please avoid using read-io whenever possible. It is a very low-level function that exposes your script to operating system-dependent oddities. For instance the amount of data typically returned may vary with the operating system, making testing more difficult for you. You also lose the convenience of line feed conversion etc., which may cause unexpected problems with your script when moving between Windows and Unix machines. "Normal" port functions in REBOL (copy, insert etc.) do these things automatically for you. We realize that in the past some shortcomings in the "normal" port functions (in particular copy blocking) have prevented you from doing some useful things, and sometimes read-io seemed to help, but these issues should be resolved in the next exp builds, and then the use of read-io will be discouraged even more than it is now. And just in case you are wondering, those new port features together with work on some additional enhancements in VID are the reasons why the new exp build for View we promised earlier is not out yet -- sorry for that delay. RSN, really... -- Holger Kruse [EMAIL PROTECTED]
[REBOL] CGI: reading POST-method data with read-io Re:
Alessandro wrote: Will read-io be fully described somewhere? ((-: I was under the impression that 'read-io was a temporary solution, while a better networking solution is being developed. I wouldn't rely on it to exist in future Rebol versions. But then I could be wrong. Anyone from Rebol Tech want to confirm or deny? Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] CGI: reading POST-method data with read-io Re:(2)
[EMAIL PROTECTED] wrote: Alessandro wrote: Will read-io be fully described somewhere? ((-: I was under the impression that 'read-io was a temporary solution, while a better networking solution is being developed. I wouldn't rely on it to exist in future Rebol versions. But then I could be wrong. IIRC Carl once said it was meant to be just a temporary solution, but looking at new networking docs at http://www.rebol.com/docs/network.html, you can notice read-io's still there ... -pekr- Anyone from Rebol Tech want to confirm or deny? Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] CGI: reading POST-method data with read-io Re:(2)
[EMAIL PROTECTED] wrote: READ-IO is very low-level, and does not extend the string. Anyway, since the new experimental release of core has asyncronous TCP ports, READ-IO should no more be needed. Could you be more specific, please? How do you want to substitute read-io read-by-buffer-size-parts functionality? Thanks, -pekr- Regards, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] CGI applications on the Macintosh
How do you make REBOL automatically run rebol scripts as CGI, on the Macintosh? If you try to launch a script by typing something like "http://127.0.0.1/cgi-bin/my-cgi.r" in your browser, the web server treats my-cgi.r as a text file, not as a CGI script. Many thanks. Philippe de Rochambeau
[REBOL] CGI applications on the Macintosh Re:
[EMAIL PROTECTED] wrote: How do you make REBOL automatically run rebol scripts as CGI, on the Macintosh? If you try to launch a script by typing something like "http://127.0.0.1/cgi-bin/my-cgi.r" in your browser, the web server treats my-cgi.r as a text file, not as a CGI script. what kind of web server are you running? In my apache web server config, there's the definition stating which suffix CGI script is allowed to have. Default is .cgi. So try to change your .r to .cgi first. CGI scripts on unix require also some #!/path/to/your/rebol.exe/on/your/server/rebol.exe --cgi as a first line ... There's also new chapter called Networking on REBOL.com website ... -pekr- Many thanks. Philippe de Rochambeau
[REBOL] CGI applications on the Macintosh Re:(2)
I am using WebStar. It seems that the REBOL interpreter for Mac will only output data to its own console. Furthermore, it is not AppleEvent compatible (that is how applications communicate on the Macintosh). Philippe de Rochambeau [EMAIL PROTECTED] a *crit : [EMAIL PROTECTED] wrote: How do you make REBOL automatically run rebol scripts as CGI, on the Macintosh? If you try to launch a script by typing something like "http://127.0.0.1/cgi-bin/my-cgi.r" in your browser, the web server treats my-cgi.r as a text file, not as a CGI script. what kind of web server are you running? In my apache web server config, there's the definition stating which suffix CGI script is allowed to have. Default is .cgi. So try to change your .r to .cgi first. CGI scripts on unix require also some #!/path/to/your/rebol.exe/on/your/server/rebol.exe --cgi as a first line .. There's also new chapter called Networking on REBOL.com website ... -pekr- Many thanks. Philippe de Rochambeau
[REBOL] CGI: reading POST-method data with read-io
- Open Your Mind - (Mr. Sassenrath should receive a CC of this message as a comment on the Network Protocols chapter, Second Revision, Draft 1) I've read the User's Guide, the old FAQs, the how-to and the recent Networking chapter, but I still lack insight on the inner workings of read-io. I can make conjectures, they may even work, but I don't like that: in the long run, I could accumulate all sorts of mistakes. -- Buffer -- We need a buffer. If we need to read 2000 bytes, the buffer is made 2002 bytes long with data1: make string! 2002 I guess the extra 2 bytes are needed to store ancillary information, but their content is not my concern, for now. Can we make the buffer as in data2: make string! 2000 or even data3: copy "" since strings can (usually?) be extended as needed? Will read-io work with a buffer like data3? Is data1 initialized like that for better performance only or is it *required* by the inner workings? -- Correct buffer-length -- According to CGI quasi-official specs, once I've checked the message body is in URL-encoded format, I must read no more than CONTENT_LENGTH bytes from system/ports/input. So if I want to go elegant and read *exactly* CONTENT_LENGTH bytes I make my buffer exactly 2 bytes longer than that and use read-io to read exactly CONTENT_LENGTH bytes, so I don't waste memory in a prudent 128 MB buffer, right? -- Data readiness -- It has been pointed out (but I can't remember where) that the message body could possibly be transported very slowly to the CGI script, due to heavy traffic on the net, so it is possible that the message body is not *fully* there when read-io is issued. On the other hand, the length you ask read-io is a *maximum* length. IIRC, Jan posted a reading cycle on the list to take care of this (will look for it as soon as I can). If CONTENT_LENGTH is, say, 22000 bytes, what happens if I request my 22000 bytes but only 1000 are available? Will read-io return the 1000 bytes immediately (which means I have to do the reading cycle) or will it wait until the whole 22000 bytes are transported and return them all? What about timeouts? -- In the end -- Will read-io be fully described somewhere? ((-: TIA. Alessandro Pini ([EMAIL PROTECTED]) "Now I'm mumblin' and I'm screamin' / And I don't know what I'm singin'" (Weird Al Yankovic)
[REBOL] cgi and normal scripts
Hey list, I have a cgi question for you. If you want to use cgi with REBOL, do you have to start out with that intention, or can you cgi-ize a regular script? more specifically, I want to use the various fields of a form as input for a "normal" script. "input-cgi.r" seems perfect. can someone spare some tips? -- Turn your computer off. Go outside. -tom
[REBOL] cgi and normal scripts Re:
You could either append input-cgi.r with your "normal" script and run it all together -or- you could 'do other scripts from input-cgi.r Hey list, I have a cgi question for you. If you want to use cgi with REBOL, do you have to start out with that intention, or can you cgi-ize a regular script? more specifically, I want to use the various fields of a form as input for a "normal" script. "input-cgi.r" seems perfect. can someone spare some tips? -- Turn your computer off. Go outside. -tom
[REBOL] cgi and normal scripts Re:
A CGI script is a script that is run by the Web server, in response to a request from a Web page - either from a form or from a hyperlink. When the server runs the script, it sends a bunch of environment variables to the script via standard input. It also directs anything the scripts sends back via standard output to the browser (rather than the consol). This is the Common Gateway Interface, or CGI. A CGI-aware scripting language, like REBOL, can read the environment variables the Web server sets, and use them in the script. So to CGI-ize a script, you "just" need to write it so it takes input from the CGI variables, and writes to standard output the same way a server would send back a Web page. (For example, a simple header to identify the document type, and then straight HTML). It's otherwise a normal script, running as the user who started the HTTP service. -Ted. *** REPLY SEPARATOR *** On 7/26/2000 at 10:09 AM [EMAIL PROTECTED] wrote: Hey list, I have a cgi question for you. If you want to use cgi with REBOL, do you have to start out with that intention, or can you cgi-ize a regular script? more specifically, I want to use the various fields of a form as input for a "normal" script. "input-cgi.r" seems perfect. can someone spare some tips? -- Turn your computer off. Go outside. -tom
[REBOL] cgi and normal scripts Re:(2)
Ooops .. should have been When the server runs the script, it sets a bunch of environment variables, and can also send user variables to the script via standard input. *** REPLY SEPARATOR *** On 7/26/2000 at 2:10 PM [EMAIL PROTECTED] wrote: A CGI script is a script that is run by the Web server, in response to a request from a Web page - either from a form or from a hyperlink. When the server runs the script, it sends a bunch of environment variables to the script via standard input. It also directs anything the scripts sends back via standard output to the browser (rather than the consol). This is the Common Gateway Interface, or CGI. A CGI-aware scripting language, like REBOL, can read the environment variables the Web server sets, and use them in the script. So to CGI-ize a script, you "just" need to write it so it takes input from the CGI variables, and writes to standard output the same way a server would send back a Web page. (For example, a simple header to identify the document type, and then straight HTML). It's otherwise a normal script, running as the user who started the HTTP service. -Ted. *** REPLY SEPARATOR *** On 7/26/2000 at 10:09 AM [EMAIL PROTECTED] wrote: Hey list, I have a cgi question for you. If you want to use cgi with REBOL, do you have to start out with that intention, or can you cgi-ize a regular script? more specifically, I want to use the various fields of a form as input for a "normal" script. "input-cgi.r" seems perfect. can someone spare some tips? -- Turn your computer off. Go outside. -tom
[REBOL] cgi and normal scripts Re:
If you send me input-cgi.r, I'll take a look at it and offer some suggestions if you like. I do a bit of CGI. -Tim At 10:09 AM 7/26/00 +0100, you wrote: Hey list, I have a cgi question for you. If you want to use cgi with REBOL, do you have to start out with that intention, or can you cgi-ize a regular script? more specifically, I want to use the various fields of a form as input for a "normal" script. "input-cgi.r" seems perfect. can someone spare some tips? -- Turn your computer off. Go outside. -tom
[REBOL] CGI saftey -- was (New REBOL Networking Document) Re:
Howdy, Petr: Reducing or DOing the decoded cgi-query block is not the recommended approach. That method allows the world to assign arbitrary words in your script to strings. Imagine this REBOL cgi program: #!/path/to/rebol -cs REBOL [] print "Content-type: text/html^/" reduce decode-cgi system/options/cgi/query-string ;- Expecting user to be passed in page: [print reform ["Hello" user]] do page quit See the danger? I can go up to my browser and type in this url: http://site/cgi-bin/script.r?page=send+me@somewhere+allyourfiles Of course, you can still be perfectly safe if the script establishes a sensible sandbox with SECURE, but the point is you don't want the outside world to be able to globally define words to strings in your CGI script. If, in the course of your CGI script, those strings could ever get interpreted as code then anyone can make your script DO arbitrary code. By making the query block into an object, this problem is completely avoided. REBOL CGI script writers should be aware of this issue. REBOL provides powerful tools to make REBOL cgi scripts air tight secure, but if the script lowers the shields then REBOL can't help you. :-) Cheers-- -jeff 8) as for cgi - another option could be added - when not creating object out of query-string, we need to 'reduce block to get its words loaded. My friend struggled with that one, as molded value of block seemed to him everything is ready :-) Later, -pekr-
[REBOL] cgi Re:(4)
Here is what I have discovered. Printing text/html output of the following... print {INPUT TYPE="hidden" name="article-reference" value="27155544"} ...passes a URL appended with "?article%2Dreference=27155544" creating a word REBOL cannot use. while... print {INPUT TYPE="hidden" name="articlereference" value="27155544"} ...passes a word REBOL can use. It seems the hyphen was causing a problem with my CGI. -Ryan INPUT TYPE="hidden" NAME="name" VALUE="value" will pass a static value with a form I need to figure out how to pass a static value with a form, one that is not generated or chosen by the submitter
[REBOL] cgi Re:(2)
Well, using... cgi-input: make object! decode-cgi system/options/cgi/query-string and then calling "comments-reference" using cgi-input/comments-reference from the url... http://www.beosjournal.com/cgi-bin/displaycomments.cgi?comments-reference= 2715121834 Worked! I can now view the comments page, although there are no comments yet and here is why: I need to send another reference value to another script which processes submitted comments. When I try to submit a comment, I get an error because the url ends up being as follows... http://www.beosjournal.com/cgi-bin/processcomments.cgi?article-reference= 2715121834?heading=First+commentbody=No+comment.name=Gemail=g%40g.mib As you can see, I try to pass an "article-reference" value by appending the url and then also try to pass form values along with the same query string, producing double "?" query string markers. I'm working on this. I need to figure out how to pass a static value with a form, one that is not generated or chosen by the submitter. -Ryan
[REBOL] cgi Re:(3)
Ryan wrote: I need to figure out how to pass a static value with a form, one that is not generated or chosen by the submitter. IIRC, hidden controls in the HTML form will provide this. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] CGI and XML Re:(3)
cgi is not that easy to debug (this i read somewhere in the archive) to prevent the printing of the XML version is not a problem anymore, however, some functions i use in my cgi script will send some result to my console, and now also to my browser example: a: probe make lit-word! "b" 'b == 'b 'b will be shown in my browser, could anyone on the list help me out please? Hendrik-Jan Bosch