View previous topic :: View next topic
|
Author |
Message |
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
I am trying to write a sample Hello World REXX CGI script on Apache server(z/OS).
tried running,
Code: |
Command ===>
********************************* Top of Data *
/*rexx*/
say "Content-type: text/html\n\n";
say "Hello, World.";
exit
******************************** Bottom of Data |
By executing the URL https://server/cgi-bin/foo.rx
But got the error,
Code: |
malformed header from script 'foo.rx': Bad header: Hello, World. |
I tried googling "REXX CGI" and all the information on the pages just goes over my head.
I was unable to find a good tutorial for dummies.
Please help.
Vasanth.S |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I am by no means an expert in REXX nor CGI but try this:
Code: |
/*rexx*/
say "Content-type: text/html\n\n";
say " ";
say "<h1>Hello, World.</h1>";
exit |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Robert, Thanks for your response.
With your program, I get the below error
Code: |
malformed header from script 'foo.rx': Bad header: |
Without the spaces, it was complaining about the Hello earlier
From USS, I am able to put an X(execute) infront of the script and it works ok. But when we invoke it from Web browser I get this error. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Hmmmm ... try taking the SAY " "; out, then. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Finally got it working, I am elated :-)
The space was getting messed up in the conversion from USS file to the server.
I had to use
Say "";
instead of
Say " ";
This works
Code: |
/* REXX */
Say 'Content-type: text/html';
Say ''; <-- the tiny detail causing the issue.
Say "<h1>It works :-)</h1>"; |
Regards,
Vasanth.S |
|
Back to top |
|
|
|