[REBOL] Re: Problem with CGI

2004-01-25 Thread Gabriele Santilli

Hi ZikZak,

On Sunday, January 25, 2004, 2:10:24 PM, you wrote:

Z> Thank you, it works now.
Z> quotes in the HTML code is strange, but I will take care of
Z> this kind of problem for my next try.

That's because that is not HTML code, but REBOL code. If you quote
it, as one big string, you don't have this problem.

  print {Email Status}

Regards,
   Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]>  --  REBOL Programmer
Amiga Group Italia sez. L'Aquila  ---   SOON: http://www.rebol.it/

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread ZikZak

Le Sun, 25 Jan 2004 05:29:04 -0700
"Ammon Johnson" <[EMAIL PROTECTED]> a écrit :

||
||Ok, what you are seeing here is that PRINT will try to obtain the
|value of a|WORD! (datatype) within a block. the simple fix for the
|error you are seeing|is to enclose the words "Email Status" in quotes
|thus making it a STRING!|instead of a word.  This should work...
||
||#!rebol -cs
||
||rebol [title: "EMail"]
||
||print "content-type: text/html^/"
||
||data: system/options/cgi/query-string
||
||cgi: make object! decode-cgi data
||
||print ["Email Status"]


Thank you, it works now.
quotes in the HTML code is strange, but I will take care of this kind of problem for 
my next try.

--
ZikZak

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread Ammon Johnson

Ok, what you are seeing here is that PRINT will try to obtain the value of a
WORD! (datatype) within a block. the simple fix for the error you are seeing
is to enclose the words "Email Status" in quotes thus making it a STRING!
instead of a word.  This should work...

#!rebol -cs

rebol [title: "EMail"]

print "content-type: text/html^/"

data: system/options/cgi/query-string

cgi: make object! decode-cgi data

print ["Email Status"]
failed: error? try [send to-email cgi/email cgi/message]
print either failed [
{the email could not be sent.}
][
[{the email to} cgi/email {was sent.}]
]
print {}


HTH
~~Ammon ;->

- Original Message - 
From: "ZikZak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 25, 2004 5:09 AM
Subject: [REBOL] Re: Problem with CGI


>
> ||A useful resource is www.rebol.org try searching for CGI and you will
> |find|many usefull examples and tools.
> ||
> ||HTH
> ||~~Ammon ;->
>
> unfortunately this is an example I tried to use.
> When I submit my form, my server returns an error page displaying this
message :
>
> ** Script Error: Email has no value ** Near: Email Status
>
> I can not figure out this message because I entered the Email value, my
URL is :
http://127.0.0.1/cgi/send.cgi?email=zikzak%40wanadoo.fr&message=Enter+your+message.%0D%0A
>
> Quite strange for a beginner like me :-(
>
> --
> ZikZak
> -- 
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
>
>
>


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread ZikZak

||A useful resource is www.rebol.org try searching for CGI and you will
|find|many usefull examples and tools.
||
||HTH
||~~Ammon ;->

unfortunately this is an example I tried to use.
When I submit my form, my server returns an error page displaying this message :

** Script Error: Email has no value ** Near: Email Status

I can not figure out this message because I entered the Email value, my URL is : 
http://127.0.0.1/cgi/send.cgi?email=zikzak%40wanadoo.fr&message=Enter+your+message.%0D%0A

Quite strange for a beginner like me :-(

--
ZikZak
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread Ammon Johnson

You got exactly what you were looking for.  The molded value of
system/options/cgi/query-string from a fresh console is "none"  If you would
like to know what the query string looks like try uploading a script to your
server that looks something like:

#!/path-to-rebol/rebol -cs

print "Content-Type: text/html^/"  ;-- Required Page Header
print ["Probing query-string..."]
probe system/options/cgi/query-string
print []

A useful resource is www.rebol.org try searching for CGI and you will find
many usefull examples and tools.

HTH
~~Ammon ;->


- Original Message - 
From: "ZikZak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 25, 2004 1:52 AM
Subject: [REBOL] Problem with CGI


>
> Hi,
>
> I'm a beginner and I don't understand why I can not obtain some
informations.
> If I try to : mold system/options/cgi/query-string then the system doesn't
give to me the informations.
>
> Why ?
>
> Regards
> --
> ZikZak
>
> REBOL/Core 2.5.6.4.2
> Copyright 1997-2003 REBOL Technologies
> REBOL is a Trademark of REBOL Technologies
> All rights reserved.
>
> Component: "REBOL Mezzanine Extensions" 1.1.2.1 (30-Nov-2002/13:47:03)
> Component: "REBOL Internet Protocols" 1.59.2.15 (15-Nov-2002/5:20:31)
> Finger protocol loaded
> Whois protocol loaded
> Daytime protocol loaded
> SMTP protocol loaded
> POP protocol loaded
> IMAP protocol loaded
> HTTP protocol loaded
> FTP protocol loaded
> NNTP protocol loaded
> Component: "System Port" 1.1.2.5 (2-Jan-2003/1:37:25)
> Script: "User Preferences" (8-Jan-2004/20:52:19+1:00)
> >> mold system/options/cgi/query-string
> == "none"
> >>
> -- 
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
>
>
>


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread ZikZak

Le Sun, 25 Jan 2004 11:48:20 +0100
Petr Krenzelok <[EMAIL PROTECTED]> a écrit :

||system/options/cgi is object, which is being given data only if rebol
|is |run in cgi mode, so - do you run your rebol session using -c
|option?|
||#!/path/to/rebol/rebol -c
||
||REBOL []
||
||your script here ... don't forget to print following two lines first:
||
||print "Content-Type: text/html"
||print newline
||
||btw: what OS and what web server do you use?
||
||
||-pekr-

Ok,

Here are the informations you need :

OS : GNU/Linux
Server : THY 0.7.1
Rebol : Core

My CGI (send.cgi) :

#!rebol -cs

rebol [title: "EMail"]

print "content-type: text/html^/"

data: system/options/cgi/query-string

cgi: make object! decode-cgi data

print [Email Status]
failed: error? try [send to-email cgi/email cgi/message]
print either failed [
{the email could not be sent.}
][
[{the email to} cgi/email {was sent.}]
]
print {}


===

My html form (email.html) :




http://127.0.0.1/cgi/send.cgi"; method="get">

CGI EMAILER

Enter your email address:



Enter your message.






=

Do you need more informations ?

Regards
--
ZikZak

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread Petr Krenzelok

ZikZak wrote:

>Hi,
>
>I'm a beginner and I don't understand why I can not obtain some informations.
>If I try to : mold system/options/cgi/query-string then the system doesn't give to me 
>the informations.
>
>Why ?
>  
>
system/options/cgi is object, which is being given data only if rebol is 
run in cgi mode, so - do you run your rebol session using -c option?

#!/path/to/rebol/rebol -c

REBOL []

your script here ... don't forget to print following two lines first:

print "Content-Type: text/html"
print newline

btw: what OS and what web server do you use?


-pekr-

>Regards
>--
>ZikZak
>
>REBOL/Core 2.5.6.4.2
>Copyright 1997-2003 REBOL Technologies
>REBOL is a Trademark of REBOL Technologies
>All rights reserved.  
>
>Component: "REBOL Mezzanine Extensions" 1.1.2.1 (30-Nov-2002/13:47:03)
>Component: "REBOL Internet Protocols" 1.59.2.15 (15-Nov-2002/5:20:31)
>Finger protocol loaded
>Whois protocol loaded
>Daytime protocol loaded
>SMTP protocol loaded
>POP protocol loaded
>IMAP protocol loaded
>HTTP protocol loaded
>FTP protocol loaded
>NNTP protocol loaded
>Component: "System Port" 1.1.2.5 (2-Jan-2003/1:37:25)
>Script: "User Preferences" (8-Jan-2004/20:52:19+1:00)
>  
>
>>>mold system/options/cgi/query-string
>>>  
>>>
>== "none"
>  
>

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: Problem with CGI

2004-01-25 Thread Carl Read

On 25-Jan-04, ZikZak wrote:

> Hi,

> I'm a beginner and I don't understand why I can not obtain some
> informations. If I try to : mold system/options/cgi/query-string
> then the system doesn't give to me the informations.

> Why ?

Because there's none to give.  (When REBOL is first launched, as in
your example below.)  Query-strings are used on servers to catch the
information added to the end of URLs, such as...

http://www.google.com/search?q=rebol

There, the "q=rebol" after the "?" is the query-string.  If the Google
website was using REBOL, "search" would be the script-name and each
time it was run when someone did a search
system/options/cgi/query-string would be loaded with what follows the
"?".

So, as far as I know, (I could be wrong - I'm no CGI expert),
query-strings are only useful when REBOL is running on a server.

If however you knew all that, are running REBOL on a server and still
are having problems, then a fuller explanation of your problem is
probably needed.

Carl Read.

> Regards
> --
> ZikZak

> REBOL/Core 2.5.6.4.2
> Copyright 1997-2003 REBOL Technologies
> REBOL is a Trademark of REBOL Technologies
> All rights reserved.  

> Component: "REBOL Mezzanine Extensions" 1.1.2.1
> (30-Nov-2002/13:47:03) Component: "REBOL Internet Protocols"
> 1.59.2.15 (15-Nov-2002/5:20:31) Finger protocol loaded
> Whois protocol loaded
> Daytime protocol loaded SMTP protocol loaded
> POP protocol loaded
> IMAP protocol loaded
> HTTP protocol loaded
> FTP protocol loaded
> NNTP protocol loaded
> Component: "System Port" 1.1.2.5 (2-Jan-2003/1:37:25) Script: "User
> Preferences" (8-Jan-2004/20:52:19+1:00)
>>> mold system/options/cgi/query-string
> == "none"
>>> 
-- 
Carl Read

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.