1. cgi
- Posted by Kat <kat at kogeijin.com> Nov 09, 2002
- 561 views
I keep getting the 302 redirect and location: in the webpage and not in the http header when i use puts(1,"Location: blahblah\n"). How do i get it into the actual header? Kat
2. Re: cgi
- Posted by Robert Szalay <robsz1 at netzero.net> Nov 10, 2002
- 497 views
You need two \n's Regards, Robert Szalay ----- Original Message ----- From: Kat <kat at kogeijin.com> Subject: cgi > > I keep getting the 302 redirect and location: in the webpage and not in the > http header when i use puts(1,"Location: blahblah\n"). How do i get it into the > actual header? > > Kat > > > >
3. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 493 views
On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > You need two \n's I tried that too, and 2 \n's and 3 \n's. And other keywords. Kat > Regards, > Robert Szalay > > ----- Original Message ----- > From: Kat <kat at kogeijin.com> > To: EUforum <EUforum at topica.com> > Sent: Sunday, November 10, 2002 2:49 AM > Subject: cgi > > > > I keep getting the 302 redirect and location: in the webpage and not in > the > > http header when i use puts(1,"Location: blahblah\n"). How do i get it > into the > > actual header? > > > > Kat > > > > > > >
4. Re: cgi
- Posted by Robert Szalay <robsz1 at netzero.net> Nov 10, 2002
- 492 views
Did you try "\r\n\r\n" ? ----- Original Message ----- From: Kat <kat at kogeijin.com> Subject: Re: cgi > > On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > > > > You need two \n's > > I tried that too, and 2 \n's and 3 \n's. And other keywords. > > Kat > > > Regards, > > Robert Szalay > > > > ----- Original Message ----- > > From: Kat <kat at kogeijin.com> > > To: EUforum <EUforum at topica.com> > > Sent: Sunday, November 10, 2002 2:49 AM > > Subject: cgi > > > > > > > I keep getting the 302 redirect and location: in the webpage and not in > > the > > > http header when i use puts(1,"Location: blahblah\n"). How do i get it > > into the > > > actual header? > > > > > > Kat > > > > > > > > >
5. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 471 views
On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > Did you try "\r\n\r\n" ? No > > ----- Original Message ----- > From: Kat <kat at kogeijin.com> > Subject: Re: cgi > > > > On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > > > > > > > You need two \n's > > > > I tried that too, and 2 \n's and 3 \n's. And other keywords. > > > > Kat > > > > > Regards, > > > Robert Szalay > > > > > > ----- Original Message ----- > > > From: Kat <kat at kogeijin.com> > > > To: EUforum <EUforum at topica.com> > > > Sent: Sunday, November 10, 2002 2:49 AM > > > Subject: cgi > > > > > > > > > > I keep getting the 302 redirect and location: in the webpage and not > in > > > the > > > > http header when i use puts(1,"Location: blahblah\n"). How do i get it > > > into the > > > > actual header? > > > > > > > > Kat > > > > > > > > > > >
6. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 492 views
On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > Did you try "\r\n\r\n" ? Yes: http://www.euforge.com/~kat/redirecttest.html > > ----- Original Message ----- > From: Kat <kat at kogeijin.com> > Subject: Re: cgi > > > > On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > > > > > > > You need two \n's > > > > I tried that too, and 2 \n's and 3 \n's. And other keywords. > > > > Kat > > > > > Regards, > > > Robert Szalay > > > > > > ----- Original Message ----- > > > From: Kat <kat at kogeijin.com> > > > To: EUforum <EUforum at topica.com> > > > Sent: Sunday, November 10, 2002 2:49 AM > > > Subject: cgi > > > > > > > > > > I keep getting the 302 redirect and location: in the webpage and not > in > > > the > > > > http header when i use puts(1,"Location: blahblah\n"). How do i get it > > > into the > > > > actual header? > > > > > > > > Kat > > > > > > > > > > >
7. Re: cgi
- Posted by irv at take.maxleft.com Nov 10, 2002
- 468 views
On Sunday 10 November 2002 04:31 pm, Kat wrote: > I keep getting the 302 redirect and location: in the webpage and not > in the http header when i use puts(1,"Location: blahblah\n"). How do i get > it into the actual header? > > Kat A redirect does not requre or allow a content-type line or any html. When you say you can see the 302 and location *in the webpage*, that makes me think that somehow your cgi is doing more than just puts(1,"Status: 302\nLocation: http://whatever.com") That's all that's needed. (be sure to put a space after the colons) Regards, Irv
8. Re: cgi
- Posted by Robert Szalay <robsz1 at netzero.net> Nov 10, 2002
- 474 views
I think i know what the problem is (but not sure yet) Try more along the lines of this: puts(1,"Content-Type: text/html\r\n") puts(1,"Location: http://www.google.com/\r\n\r\n") ----- Original Message ----- From: Kat <kat at kogeijin.com> Subject: Re: cgi > ============ The Euphoria Mailing List ============ > > On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > > > > Did you try "\r\n\r\n" ? > > Yes: > http://www.euforge.com/~kat/redirecttest.html > > > > > ----- Original Message ----- > > From: Kat <kat at kogeijin.com> > > To: EUforum <EUforum at topica.com> > > Sent: Sunday, November 10, 2002 1:25 PM > > Subject: Re: cgi > > > > > > > On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > > > > > > > > > > You need two \n's > > > > > > I tried that too, and 2 \n's and 3 \n's. And other keywords. > > > > > > Kat > > > > > > > Regards, > > > > Robert Szalay > > > > > > > > ----- Original Message ----- > > > > From: Kat <kat at kogeijin.com> > > > > To: EUforum <EUforum at topica.com> > > > > Sent: Sunday, November 10, 2002 2:49 AM > > > > Subject: cgi > > > > > > > > > > > > > I keep getting the 302 redirect and location: in the webpage and not > > in > > > > the > > > > > http header when i use puts(1,"Location: blahblah\n"). How do i get it > > > > into the > > > > > actual header? > > > > > > > > > > Kat > > > > > > > > > > > ==^================================================================ > This email was sent to: robsz1 at netzero.net > > EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b3fcPV.cm9ic3ox > Or send an email to: EUforum-unsubscribe at topica.com > > T O P I C A -- Register now to manage your mail! > http://www.topica.com/partner/tag02/register > ==^================================================================ > > --------------------------------------------- Introducing NetZero Long Distance 1st month Free! Sign up today at: www.netzerolongdistance.com
9. Re: cgi
- Posted by irv at take.maxleft.com Nov 10, 2002
- 475 views
On Sunday 10 November 2002 05:43 pm, you wrote: > > On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > Did you try "\r\n\r\n" ? > > Yes: > http://www.euforge.com/~kat/redirecttest.html Kat: Please post a copy of redirecttest.html (or e-mail privately if you wish) Irv
10. Re: cgi
- Posted by munchr at mac.com Nov 10, 2002
- 507 views
Kat, if I am interpreting that link correctly, it appears that the webserver is sending the html file directly to the browser, rather than treating it as an executable script file needing to be parsed by Euphoria. You may need to set permissions on the file to executable, or you may need to configure the webserver to treat files not inside the cgi-bin directory as executable. James Powell At 04:43 PM 10/11/2002 -0600, Kat wrote: > >On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > > > > Did you try "\r\n\r\n" ? > >Yes: >http://www.euforge.com/~kat/redirecttest.html > > > > > ----- Original Message ----- > > From: Kat <kat at kogeijin.com> > > To: EUforum <EUforum at topica.com> > > Sent: Sunday, November 10, 2002 1:25 PM > > Subject: Re: cgi > > > > > > > On 10 Nov 2002, at 4:22, Robert Szalay wrote: > > > > > > > > > > > You need two \n's > > > > > > I tried that too, and 2 \n's and 3 \n's. And other keywords. > > > > > > Kat > > > > > > > Regards, > > > > Robert Szalay > > > > > > > > ----- Original Message ----- > > > > From: Kat <kat at kogeijin.com> > > > > To: EUforum <EUforum at topica.com> > > > > Sent: Sunday, November 10, 2002 2:49 AM > > > > Subject: cgi > > > > > > > > > > > > > I keep getting the 302 redirect and location: in the webpage and not > > in > > > > the > > > > > http header when i use puts(1,"Location: blahblah\n"). How do i > get it > > > > into the > > > > > actual header? > > > > > > > > > > Kat > > > > > > > > > > > >
11. Re: cgi
- Posted by jbrown105 at speedymail.org Nov 10, 2002
- 465 views
It looks like that the program is not being executed, but rather the program is returned AS the file. Make sure that its in cgi-bin, that it is +x (executable bit on). Also i noticed that you just put "#!exu" for the top line of the script. This is fine if exu is in the path. Otherwise, you MUST put the full path of the exu binary in the script! BTW, if exu is in the current directory, you must put "./", the current directoy is NOT part of the path in Unix, unlike DOS/Windows (for security reasons I believe). Finally, make sure the script is in Unix-text file format (LF), and not DOS (CRLF) format. jbrown --
12. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 481 views
On 11 Nov 2002, at 0:43, jbrown105 at speedymail.org wrote: > > It looks like that the program is not being executed, but rather the > program > is returned AS the file. Make sure that its in cgi-bin, that it is +x > (executable bit on). I can't change anything, i can't even delete subdirs i made while testing. > Also i noticed that you just put "#!exu" for the top line of the script. > This is fine if exu is in the path. Otherwise, you MUST put the full path > of the exu binary in the script! BTW, if exu is in the current directory, > you must put "./", the current directoy is NOT part of the path in Unix, > unlike DOS/Windows (for security reasons I believe). I did. I tried moving exu to the folder, and i tried moving the Eu program to the cgi-bin dir where exu can execute. Same results. > Finally, make sure the script is in Unix-text file format (LF), and not > DOS (CRLF) format. I have tried \n, \r, \rn ,, same results. In Mirc, years ago, i did this: alias sendheader { ; echo -s sendheader. $1 set %httpd.starttime. [ $+ [ $1 ] ] $ticks sockwrite $1 HTTP/1.1 200 OK $crlf sockwrite $1 Date: $date(dddd) $+ , $date(mmm) $date(d) $+ , $date(yyyy) $crlf sockwrite $1 Server: Kat v2.0 on mIRC v5.51 $crlf sockwrite $1 Content-Location: %httpd.dirlist. [ $+ [ $1 ] ] $crlf sockwrite $1 Content-Type: text/html $crlf sockwrite $1 $crlf } which still works to this day. But why doing the same easy writes in Eu on *nix is impossible is just incredible to me. I'd have arranged the world so the more modern and professional stuff is easier and quicker to run and build, not worse. I have no clue STILL if a server on a nix shell will be theaded or multitasking, so multiple requests can be handled at once, like mirc can do, like a server using tcp.e can do on win95,,, or if i am taking a huge step back to the much-maligned days of msdos by using a nix shell. Basically, the problem is all the restrictions, the lack of docs, and that i wrote the whole httpd in mirc, i didn't write Apache or *nix, and the knowledge to use them outside "normal" is coveted and held only by the priest(ess)es of the procedure. Kat
13. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 473 views
On 10 Nov 2002, at 17:53, irv at take.maxleft.com wrote: > > On Sunday 10 November 2002 05:43 pm, you wrote: > > > > On 10 Nov 2002, at 16:31, Robert Szalay wrote: > > > Did you try "\r\n\r\n" ? > > > > Yes: > > http://www.euforge.com/~kat/redirecttest.html > > Kat: > > Please post a copy of redirecttest.html (or e-mail privately if you wish) > Irv It's at that url, Irv. That's what i am complaining of, it's not executing, even if it is in the cgi-bin with exu, or if i put exu into the public directory. Redirecttest.html is diplayed as a page, not executed. Kat
14. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 476 views
On 10 Nov 2002, at 17:50, irv at take.maxleft.com wrote: > > On Sunday 10 November 2002 04:31 pm, Kat wrote: > > > I keep getting the 302 redirect and location: in the webpage and not > > in the http header when i use puts(1,"Location: blahblah\n"). How do i get > > it > > into the actual header? > > > > Kat > > A redirect does not requre or allow a content-type line or any html. > When you say you can see the 302 and location *in the webpage*, > that makes me think that somehow your cgi is doing more than just > > puts(1,"Status: 302\nLocation: http://whatever.com") > > That's all that's needed. (be sure to put a space after the colons) I did Irv. Kat
15. Re: cgi
- Posted by jbrown105 at speedymail.org Nov 10, 2002
- 486 views
On 0, Kat <kat at kogeijin.com> wrote: > > On 11 Nov 2002, at 0:43, jbrown105 at speedymail.org wrote: > > > > > It looks like that the program is not being executed, but rather the > > program > > is returned AS the file. Make sure that its in cgi-bin, that it is +x > > (executable bit on). > > I can't change anything, i can't even delete subdirs i made while testing. You can't do "chmod +x exu;chmod +x <scriptname>"? If you cant, that this will be a very big problem. Talk to the person who runs that site about fixing you permissions. > > > Also i noticed that you just put "#!exu" for the top line of the script. > > This is fine if exu is in the path. Otherwise, you MUST put the full path > > of the exu binary in the script! BTW, if exu is in the current directory, > > you must put "./", the current directoy is NOT part of the path in Unix, > > unlike DOS/Windows (for security reasons I believe). > > I did. I tried moving exu to the folder, and i tried moving the Eu program to > the > cgi-bin dir where exu can execute. Same results. Did you change the top line from "#!exu" to "#!./exu" or "#!/<full path to binary from root dir>/exu" Stil > > > Finally, make sure the script is in Unix-text file format (LF), and not > > DOS (CRLF) format. > > I have tried \n, \r, \rn ,, same results. You misunderstand. The _file_ which is the script, not what is being sent by the script. The _file_ needs to be Unix text file, else it will NOT be recongized as a program but merely a file. > In Mirc, years ago, i did this: > > alias sendheader { > ; echo -s sendheader. $1 > set %httpd.starttime. [ $+ [ $1 ] ] $ticks > sockwrite $1 HTTP/1.1 200 OK $crlf > sockwrite $1 Date: $date(dddd) $+ , $date(mmm) $date(d) $+ , > $date(yyyy) $crlf > sockwrite $1 Server: Kat v2.0 on mIRC v5.51 $crlf > sockwrite $1 Content-Location: %httpd.dirlist. [ $+ [ $1 ] ] $crlf > sockwrite $1 Content-Type: text/html $crlf > sockwrite $1 $crlf > } > > which still works to this day. But why doing the same easy writes in Eu on > *nix is impossible is just incredible to me. I'd have arranged the world so > the > more modern and professional stuff is easier and quicker to run and build, > not worse. I have no clue STILL if a server on a nix shell will be theaded or > multitasking, so multiple requests can be handled at once, like mirc can do, > like a server using tcp.e can do on win95,,, or if i am taking a huge step > back > to the much-maligned days of msdos by using a nix shell. Its simple enough, but you must learn basic *nix first, or else the learning curve increases greatly. > > Basically, the problem is all the restrictions, the lack of docs, and that i > wrote the whole httpd in mirc, i didn't write Apache or *nix, and the > knowledge to use them outside "normal" is coveted and held only by the > priest(ess)es of the procedure. Well, good luck. I'll offer whatever I know. BTW, how much *nix do you know? > > Kat > jbrown Linux User:190064 Linux Machine:84163 -- http://fastmail.fm - mmm... fastmail...
16. Re: cgi
- Posted by irv at take.maxleft.com Nov 10, 2002
- 483 views
On Sunday 10 November 2002 05:52 pm, you wrote: > > I think i know what the problem is (but not sure yet) > > Try more along the lines of this: > > puts(1,"Content-Type: text/html\r\n") > puts(1,"Location: http://www.google.com/\r\n\r\n") If you don't output "Status: 302\n", you certainly won't get a redirect. The Content-Type line is unnecessary, but didn't cause any problem when I added it. Regards, Irv
17. cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 474 views
Ok Rob, how much "big bucks" do you want to set up the application i need on a nix server? Kat
18. Re: cgi
- Posted by Robert Szalay <robsz1 at netzero.net> Nov 10, 2002
- 478 views
I am able to redirect just fine with this(and only this): puts(1, "Location: http://www.google.com/\r\n\r\n") ----- Original Message ----- From: <irv at take.maxleft.com> Subject: Re: cgi On Sunday 10 November 2002 05:52 pm, you wrote: > > I think i know what the problem is (but not sure yet) > > Try more along the lines of this: > > puts(1,"Content-Type: text/html\r\n") > puts(1,"Location: http://www.google.com/\r\n\r\n") If you don't output "Status: 302\n", you certainly won't get a redirect. The Content-Type line is unnecessary, but didn't cause any problem when I added it. Regards, Irv ==^^=============================================================== This email was sent to: robsz1 at netzero.net EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b3fcPV.cm9ic3ox Or send an email to: EUforum-unsubscribe at topica.com T O P I C A -- Register now to manage your mail! http://www.topica.com/partner/tag02/register ==^^=============================================================== --------------------------------------------- Introducing NetZero Long Distance 1st month Free! Sign up today at: www.netzerolongdistance.com
19. Re: cgi
- Posted by Kat <kat at kogeijin.com> Nov 10, 2002
- 481 views
On 10 Nov 2002, at 21:39, Robert Szalay wrote: > > I am able to redirect just fine with this(and only this): > > puts(1, "Location: http://www.google.com/\r\n\r\n") Unkmar gave me his file, which i put in instead of mine, his works, mine doesn't, same words, different url. They look identical otherwise in Textpad on my puter and in nano on the shell. <shrug> Still, this redirect exposes the target url, and would expose my ip# to the user. Since i have no bandwidth, the major point of this is to hide my ip# so i cannot be DoS'd. The 2nd major point is to have me initiate the backside connection to the shell, and not haveto open an incoming hole thru the firewall here. So i still need this: 1) program to accept incoming http from a browser on a nix shell, most probably an freebsd flavor 2) a program for me to connect to, either user!pass@url http with unlimited ttl, or a ftp-like connection for me to get output from 3) 3) the part i write to munge output of 1) and have sent to me thru 2) This part will need to accept back what i send up to 2), and send back thru 1) to the user. Kat > ----- Original Message ----- > From: <irv at take.maxleft.com> > To: EUforum <EUforum at topica.com> > Sent: Sunday, November 10, 2002 8:30 PM > Subject: Re: cgi > > > On Sunday 10 November 2002 05:52 pm, you wrote: > > > > I think i know what the problem is (but not sure yet) > > > > Try more along the lines of this: > > > > puts(1,"Content-Type: text/html\r\n") > > puts(1,"Location: http://www.google.com/\r\n\r\n") > > If you don't output "Status: 302\n", you certainly won't get a redirect. > The Content-Type line is unnecessary, but didn't cause any problem > when I added it. > > Regards, > Irv > > > ==^================================================================ > This email was sent to: kat at kogeijin.com > > EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b3cnso.a2F0QGtv > Or send an email to: EUforum-unsubscribe at topica.com > > T O P I C A -- Register now to manage your mail! > http://www.topica.com/partner/tag02/register > ==^================================================================ >
20. Re: cgi
- Posted by "Thomas Parslow (PatRat)" <patrat at rat-software.com> Oct 10, 2001
- 484 views
> I'm trying to write a cgi program that sends an an iamge whenever > called. I'm simply doing this: > puts(1, "Location: /isplaying.bmp\n\n") > and then bind with bindw to make a win32 .exe. I can put this in my > cgi-bin directory and (if my server's running of course), this works. > My browser loads whatever the image is on the server, not in cache, > which was my goal. My problem is that, everytime a browser calles it, a > console window flashes and disappears. Is there any way I can keep this > from happening, and have it execute silently? I've scoured the Euphoria > docs, but I suspect its a windows flag to be set or routine to be called > and I know *very* little about that. Making the cgi into a dos exe will work, not sure about how to get it working as a win32 exe. One thing that might be a problem, afaik most browsers don't support BMPs. You'll probably need to save the images as GIFs, I think there are some librarys for saving GIFs in the archives. Thomas Parslow (PatRat) ICQ #:26359483 Rat Software http://www.rat-software.com/ Please leave quoted text in place when replying
21. Re: cgi
- Posted by rolf.schroeder at desy.de Oct 10, 2001
- 475 views
"Thomas Parslow (PatRat)" wrote: > ... > Making the cgi into a dos exe will work, not sure about how to get it > working as a win32 exe. > If the WWW-Server runs under WIN32 then a win32 exe runs fine. > One thing that might be a problem, afaik most browsers don't support > BMPs. You'll probably need to save the images as GIFs, I think there > are some librarys for saving GIFs in the archives. As far as I read about one has to use GIFs or JPGs or PNGs. Have a nice day, Rolf
23. Re: cgi
- Posted by r.schr at t-online.de Oct 10, 2001
- 475 views
Cassidy Napoli wrote: > > ... How do I > prevent the console from opening and closing whenever the browser > requests the image? > Does it mean that a new win32 window opens if you send a request to your CGI program? Have a nice day, Rolf
24. Re: cgi
- Posted by r.schr at t-online.de Oct 10, 2001
- 485 views
Cassidy Napoli wrote: > > I could live with this, but I want to distribute the program, and it > doesn't do any good if you're trying to get work done and a dos-box > keeps opening and shutting on you. > Are you sure your program runs on the CGI server? It look like it runs simply under your local CMD window in DOS mode. The first output line in your CGI program has to be: puts(1,"Content-Type: text/html\n\n") Do you have this starting line? Have a nice day, Rolf
25. Re: cgi
- Posted by rolf.schroeder at desy.de Oct 11, 2001
- 485 views
This is a multi-part message in MIME format. --------------0D57AB8739B5A9A178F21953 Cassidy Napoli wrote: > ... > puts(1,"Location: /resource.xxx\n\n") > This tells the browser to load whatever the resource is, from the server > running the cgi. This is in place of content-type. Nothing else needs > to be sent to the browser, the browser just gets whatever is at the > location and displays that. It could be an image, video, another > webpage, whatever. > ... Hi Cassidy, is it absolutely clear that the program line: puts(1,"Location: /resource.xxx\n\n") is the first output of the program at the CGI SERVER SIDE called by the client browser? I append an example including an image. make a DIR 'test' under 'cgi-bin' on your CGI server, copy all files into the 'test' dir, run 'bindw test' to create en win32 executable and call from your browser: 'http://ServerName/cgi-bin/test/test.exe' enjoy! Have a nice day, Rolf --------------0D57AB8739B5A9A178F21953 Content-Type: application/x-zip-compressed; name="test.zip" Content-Transfer-Encoding: base64