Re: Getting data from external URL
Hello, Thanks everyone for such a simple solutions. I think I will use followig method as it seems much simpler. Thanks Vijay - Original Message - From: "Rodney Broom" [EMAIL PROTECTED] To: "Stas Bekman" [EMAIL PROTECTED] Cc: "Vijay" [EMAIL PROTECTED]; "mod_perl Maillinglist" [EMAIL PROTECTED] Sent: Saturday, August 26, 2000 10:24 AM Subject: Re: Getting data from external URL SB This one is much more efficient and requires even less coding: SB use LWP::Simple; SB $content = get("http://www.sn.no/") Even better, thanks Stas.
Getting data from external URL
Hello, I want to get data from an external url in my perl program (either thru Embperl Execute or directly from perl). What I need is like this. There is a URL which gives some information in text format. I want to get that into a variable or file using perl and using my own html templates, I want to show that data. If anyone has done something like this, please let me know. Thanks Vijay
Re: Wierd problem with redirect
Hello, Thanks for the suggestion. However, I have a problem still left out. The redirection is loading the redirected page properly. But, it still shows the URL as the same from where it is redirected. As below: My form calls the script "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". In visitorinfo,.cgi, I have following steps print "Content-type: text/html\n"; print "$mycookie\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; It really goes to the page mailhdr with appropriate details. But the address in the browser is still "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". This gives a problem. If the user reloads the page, it will again try to do what I am doing in this, which I don't want to happen. How do I make the address (URL) to change according to the page it is showing. Thanks for the helps Vijay Nair - Original Message ----- From: "Gerald Richter" [EMAIL PROTECTED] To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 3:05 AM Subject: RE: Wierd problem with redirect Hello, print "Content-type: text/html\n\n"; print "HTMLHEAD"; print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid; path=/ ; domain=www.trichurgateway.com;\""; print "/HEADBODY/BODY/HTML\n"; Immediately after this, Iam trying the recirect. print "Content-type: text/html "."\n\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; You cannot send a second http header. Do a print "Content-type: text/html\n"; print "Set-Cookie: visirotid=$visitorid;... \n" ; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
REPOST: Wierd problem with redirect
Reposting. - Original Message - From: "Vijay" [EMAIL PROTECTED] To: "Gerald Richter" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 10:58 AM Subject: Re: Wierd problem with redirect Hello, Thanks for the suggestion. However, I have a problem still left out. The redirection is loading the redirected page properly. But, it still shows the URL as the same from where it is redirected. As below: My form calls the script "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". In visitorinfo,.cgi, I have following steps print "Content-type: text/html\n"; print "$mycookie\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; It really goes to the page mailhdr with appropriate details. But the address in the browser is still "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". This gives a problem. If the user reloads the page, it will again try to do what I am doing in this, which I don't want to happen. How do I make the address (URL) to change according to the page it is showing. Thanks for the helps Vijay Nair ----- Original Message - From: "Gerald Richter" [EMAIL PROTECTED] To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 3:05 AM Subject: RE: Wierd problem with redirect Hello, print "Content-type: text/html\n\n"; print "HTMLHEAD"; print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid; path=/ ; domain=www.trichurgateway.com;\""; print "/HEADBODY/BODY/HTML\n"; Immediately after this, Iam trying the recirect. print "Content-type: text/html "."\n\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; You cannot send a second http header. Do a print "Content-type: text/html\n"; print "Set-Cookie: visirotid=$visitorid;... \n" ; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Wierd problem with redirect
Repost of my earlier message. Sorry for the inconvenience. As this is very irksome, I am really sorry for any troubles. Vijay - Original Message - From: "Vijay" [EMAIL PROTECTED] To: "Gerald Richter" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 10:58 AM Subject: Re: Wierd problem with redirect Hello, Thanks for the suggestion. However, I have a problem still left out. The redirection is loading the redirected page properly. But, it still shows the URL as the same from where it is redirected. As below: My form calls the script "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". In visitorinfo,.cgi, I have following steps print "Content-type: text/html\n"; print "$mycookie\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit; It really goes to the page mailhdr with appropriate details. But the address in the browser is still "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". This gives a problem. If the user reloads the page, it will again try to do what I am doing in this, which I don't want to happen. How do I make the address (URL) to change according to the page it is showing. Thanks for the help Vijay Nair ----- Original Message - From: "Gerald Richter" [EMAIL PROTECTED] To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 3:05 AM Subject: RE: Wierd problem with redirect Hello, print "Content-type: text/html\n\n"; print "HTMLHEAD"; print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid; path=/ ; domain=www.trichurgateway.com;\""; print "/HEADBODY/BODY/HTML\n"; Immediately after this, Iam trying the recirect. print "Content-type: text/html "."\n\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; You cannot send a second http header. Do a print "Content-type: text/html\n"; print "Set-Cookie: visirotid=$visitorid;... \n" ; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Weird problem with redirect
Hi, This solved my problem. Thanks everyone for your help. Vijay - Original Message - From: "Biggs, Jody" [EMAIL PROTECTED] To: "'Vijay'" [EMAIL PROTECTED] Cc: "Modperl Mailing List (E-mail)" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 4:59 PM Subject: RE: Weird problem with redirect Unless you specify an absolute URL for the Location header, Apache will do an internal redirect (i.e., it won't send a redirect to the browser, it will just recognize that you're trying to redirect them, and just transfer the request to the new page). so do: print "$mycookie\n"; print "Location: http://www.yourhost.com/scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n \n" by the way - when doing a 302 redirect, it is not necessary to do a Content-type header. - Jody Biggs -Original Message- From: Vijay [mailto:[EMAIL PROTECTED]] Sent: Friday, May 26, 2000 3:27 PM To: Gerald Richter; Modperl Mailing List Subject: Re: Wierd problem with redirect Repost of my earlier message. Sorry for the inconvenience. As this is very irksome, I am really sorry for any troubles. Vijay - Original Message - From: "Vijay" [EMAIL PROTECTED] To: "Gerald Richter" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 10:58 AM Subject: Re: Wierd problem with redirect Hello, Thanks for the suggestion. However, I have a problem still left out. The redirection is loading the redirected page properly. But, it still shows the URL as the same from where it is redirected. As below: My form calls the script "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". In visitorinfo,.cgi, I have following steps print "Content-type: text/html\n"; print "$mycookie\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit; It really goes to the page mailhdr with appropriate details. But the address in the browser is still "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1". This gives a problem. If the user reloads the page, it will again try to do what I am doing in this, which I don't want to happen. How do I make the address (URL) to change according to the page it is showing. Thanks for the help Vijay Nair - Original Message - From: "Gerald Richter" [EMAIL PROTECTED] To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED] Sent: Friday, May 26, 2000 3:05 AM Subject: RE: Wierd problem with redirect Hello, print "Content-type: text/html\n\n"; print "HTMLHEAD"; print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid; path=/ ; domain=www.trichurgateway.com;\""; print "/HEADBODY/BODY/HTML\n"; Immediately after this, Iam trying the recirect. print "Content-type: text/html "."\n\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; You cannot send a second http header. Do a print "Content-type: text/html\n"; print "Set-Cookie: visirotid=$visitorid;... \n" ; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Wierd problem with redirect
Hello, I have a perl script which tries to redirect the URL to another page. It gives peculiar problem. The resultant page source is as follows --- HTMLHEADMETA HTTP-EQUIV="Set-Cookie" CONTENT="visirotid=880; path=/; domain=www.trichurgateway.com;"/HEADBODY/BODY/HTML Content-type: text/html Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN - As you can see, the Content-type and Location information is shown in the screen rather than really taking the url. THe perl code is as follows: First I am setting the cookie. print "Content-type: text/html\n\n"; print "HTMLHEAD"; print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid; path=/ ; domain=www.trichurgateway.com;\""; print "/HEADBODY/BODY/HTML\n"; Immediately after this, Iam trying the recirect. print "Content-type: text/html "."\n\n"; print "Location: /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n"; exit 0; This results in the page as given above. IN the Location, I tried giving full url including the domain name. Also, I tried to use CGI-redirect also. It showed the page moved to new location error on the screen. Not the actual page. This is running on a Raq3i server with perl 5.0.6 and mod-perl (version I am not sure) and Embperl. Any help is greatly appreciated. Thanks Vijay Nair
Silly Question
Hello, We recently bought a new Raq3 server. We have developed a script to add users directly from the web interface. IT is bombing out as the script should be run as 'root'. I want to know if the script can be set with setuid as root for execution. Thanks for any help. VIjay
Re: EmbPerl and scope
I used following method to get Embperl working in my system. [- Execute ('other.html',"$a") -] other.html The value of a is [+ $param[0] +] This works fine. Vijay Nair - Original Message - From: Louis Trochatos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 15, 2000 8:19 PM Subject: EmbPerl and scope I am having trouble with embperl and scope. I read the FAQ on this but I still can't get it to work. As an example let's say I have two files: file1: index.html -- [- $a = 1 -] [- Execute ('other.html') -] file2: other.html --- The value is the variale a is: [+ $a +] when i bring up index.html it does import other.html fine but the $a variale is empty - scope problem. What exactly do i need to do to these files so they can talk to each other. Also does anyone know of a good embperl book on the market? thanks Louis
Re: URL Redirection
Hello, I got a work around for the problem I am having. - Set a cookie header using meta command as set-cookie is not working properly on my box thru mod_perl. Somewhere it is creating a problem and I am not sure where. Using meta command I set up a cookie for the session id. - Create a file on my disk with all parameters selected by the user with the session-id as the file id. - Get the session-id using the environment variable $ENV('HTTP_COOKIE'} - Load the file with the session id and populate the user selected parameters as well as add new selections - Pass-on these parameters to the web pages (Embperl encoded) using the HTML::Embperl::Execute command. At present, all these are done thru three scripts. Although the browser address is not showing thefull URL, it shows correct results. I am trying more to refine this and createone generic Perl script to handle all pages in my site. Thanks for all your help. Vijay - Original Message - From: Gerald Richter To: Vijay ; mod_perl Maillinglist Sent: Sunday, January 09, 2000 2:01 PM Subject: RE: URL Redirection As I was having problem to set up Embperl as CGI, I found out a way to workaround that. To call HTML::Embperl::Execute from my perl script and pass the html document as parameter. This works OK. That is, like Tom and Vivek pointed out, cgiwrapper eats the PATH_INFO and PATH_TRANSLATED What I want to achieve is to have the some session info (basically I want to create my own session persistant data for various statistical purposes) to be part of the URL. (I mean the browser address to show something like http://my.domain.com/myplscript.pl?session=1id=21). I am using a generic perl script to manage all pages and using embperl to link each together. My problem is the "Location: myscript.pl?session=1id=21" is not showing in the address line fully, but executing properly. This will give me a problem if the user reloads or move backwards from other page. I want the address line to show full url address including the parameters when I redirect it so that reloads and backwards will work properly. Sorry, but I don't understand what you mena Gerald -Gerald Richter ecos electronic communication services gmbhInternetconnect * Webserver/-design/-datenbanken * ConsultingPost: Tulpenstrasse 5 D-55276 Dienheim b. MainzE-Mail: [EMAIL PROTECTED] Voice: +49 6133 925151WWW: http://www.ecos.de Fax: +49 6133 925152-
URL Redirection
Hello, As I was having problem to set up Embperl as CGI, I found out a way to workaround that. To call HTML::Embperl::Execute from my perl script and pass the html document as parameter. This works OK. What I want to achieve is to have the some session info (basically I want to create my own session persistant data for various statistical purposes) to be part of the URL. (I mean the browser address to show something like http://my.domain.com/myplscript.pl?session=1id=21). I am using a generic perl script to manage all pages and using embperl to link each together. My problem is the "Location: myscript.pl?session=1id=21" is not showing in the address line fully, but executing properly. This will give me a problem if the user reloads or move backwards from other page. I want the address line to show full url address including the parameters when I redirect it so that reloads and backwards will work properly. Any suggestions are greatly appreciated. Thanks in advance, Vijay Nair
Re: Embperl under cgiwraper
Hello, I have setup srm.conf as given below. Directory /home/sites/home/web Action text/html /scripts/embpcgi.pl /Directory I believe that by default all html files under this directory should be processed by embpcgi.pl. This is what is not happening. I may have not set up properly. I have installed embperl without support for mod_perl. I want to use it as CGI. Thanks for all help. Vijay Nair - Original Message - From: Gerald Richter [EMAIL PROTECTED] To: Vijay [EMAIL PROTECTED] Cc: mod_perl Maillinglist [EMAIL PROTECTED] Sent: Friday, January 07, 2000 1:36 PM Subject: RE: Embperl under cgiwraper unshift(@INC, '/home/sites/home/HTML-Embperl-1.2.0/blib/lib' ); print "@INC\n"; You don't need this, if you have run "make install" [11765]ERR: 30: Line 1: Not found ? This error message comes from Embperl. So the embpcgi.pl is still found, otherwise you wouldn't see this message, but Embperl didn't a/the file which should be processed. From the error message it seems you didn't give Embperl any sourcefile to process. You must request it like this: http://localhost/cgi-bin/embpcgi.pl/path/to/the/source.html where /path/to/the/source.html is your source file, that means, if you request only http://localhost/path/to/the/source.html you should simply see your raw source. Hope this helps Gerald
Embperl under cgiwraper
Hello, In my system, cgiwraper is installed and is used as wraper for all .pl and .cgi scripts. I tried to install embperl without any success. Everytime I get the error cgiwraper not found for embperl. Any help is appreciated. Thanks and Regards Vijay Nair