HTML textarea contents into Perl CGI
Hi, If this has been answered before please direct me there as I am at a loss as to where to look as there is so much info to plow thru. Situation: I am reading into my script via param() a textarea called Job Duties. When I print out that parameter in perl all of the new lines are ignored and it prints as one long string. Q: How do I get the perl print statement to recognize the new lines so that the printed output looks like the html input screen? Perhaps the print statement is the wrong thing to use but. I've been looking at regex's and the split function and have been able to determine that there are infact newlines in the data but they are being ignore when I print out the data. Any assistance would be great. Thanks. Joe Pond [EMAIL PROTECTED]
Re: HTML textarea contents into Perl CGI
So where do you print out the data ? In a console ( shell or dosprmpt ) ? or as a html page ? If that's the first case, it should not be happened unless you do something to elimate the \n operator If the second case, assum you should know, HTML will not auto break line even in your souce is. So you better use print pre$data/pre or $data =~ s/\n/BR/g; print $data - Original Message - From: jmpond [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 30, 2002 5:31 AM Subject: HTML textarea contents into Perl CGI Hi, If this has been answered before please direct me there as I am at a loss as to where to look as there is so much info to plow thru. Situation: I am reading into my script via param() a textarea called Job Duties. When I print out that parameter in perl all of the new lines are ignored and it prints as one long string. Q: How do I get the perl print statement to recognize the new lines so that the printed output looks like the html input screen? Perhaps the print statement is the wrong thing to use but. I've been looking at regex's and the split function and have been able to determine that there are infact newlines in the data but they are being ignore when I print out the data. Any assistance would be great. Thanks. Joe Pond [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accepting cookies with LWP?
On Sun, 30 Jun 2002 06:27:27 +0300, [EMAIL PROTECTED] (Octavian Rasnita) wrote: Hi all, I've tried to get a web page with the following line: use LWP::Simple; my $page = get($path); The problem is that LWP gets another page telling me that I should login or I should enable my browser to accept cookies. What should I do to make LWP to accept cookies? Is it possible with LWP::Simple, or I should use LWP::UserAgent? This is from a LWP howto at perlmonks.org, a great resource. If you want to do several requests, of which the first should include a login, or something else stateful which uses cookies, you can even attach a cookiejar to use with LWP::Simple: use LWP::Simple qw($ua get); use HTTP::Cookies; $ua-cookie_jar(HTTP::Cookies-new); get $webpage . $login_string; my $logged_in_page = get $webpage . $private_page; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cgi probs
Ian, Which version of Apache? 1.3.x, or 2.x? Here is where to find the documentation: http://httpd.apache.org/docs-project/ Most changes you would need to make in Apache are in the 'httpd.conf' file. Like Randal said, though, it's ultimately up to the browser how to process the file if there is not a handler for it on the server. If you have the browser set to display text/plain docs in the browser, there's not much you can do to change that situation on the server. One trick you can try is to put it in a zip file; most browsers will prompt you to either save or open that type of file. You might want to read the Apache documentation for the 'AddHandler' directive as well; this may provide some assistance. http://httpd.apache.org/docs/mod/mod_mime.html#addhandler HTH, Scot R. inSite -Original Message- From: Ian Rogers [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 30, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: RE: cgi probs yes it is, but i am not sure if it is setup right. like i say i have installed linux, but haven't done anything with apache. What do i need to do to configure and run apache, as that could well be my problem. thanks Ian Scot Robnett [EMAIL PROTECTED] wrote: I hate to ask the obvious, but is your web server running on that box? Scot R. -Original Message- From: Ian Rogers [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 5:19 PM To: [EMAIL PROTECTED] Subject: cgi probs Hi I have set up my machine running suse linux, and i am now trying to get cgi working. I have written a html for to post the data and a basic cgi script to read in and print out the results. I have written cgi code on other machines so the code is correct, but i am having trouble on my machine. When i press the submit button it comes up with a message to confirm if i want to send the data, but when i click on ok, nothing happens, just like it can't find the script, but i have put the correct path for the script in the form action. is there anything i need to do apart from i! nstalling perl? i have placed my cgi script in my cgi-bin directory, and the htlm file in the www/public_html directory. I am not sure what i am doing wrong any help would be fully apreciated thanks Ian - Relive the FIFA World Cup goals with exclusive video highlights! http://fifaworldcup.yahoo.com/fc/en Relive the FIFA World Cup goals with exclusive video highlights! http://fifaworldcup.yahoo.com/fc/en --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Including External Pages
What would I use to include external pages in my script? (like if I wanted to print the contents of faq.txt or log.cgi in my script) Is there a way to do the above except to include a php script instead of a txt file and have both the cgi and php function correctly? Thank you, Kyle -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Including External Pages
Yes, but I'm trying to do this from within a perl script. How would the file get parsed as .shtml and .cgi (or .pl)? On Sun, 30 Jun 2002 18:18:12 -0400, Jim Lundeen [EMAIL PROTECTED] said: check out Server-Side Includes - particularly Include Virtual and Exec CGI (execute CGI). Here's a link I just grabbed from Google, there are plenty of references out there though... http://www.webcom.com/~webcom/help/inc/include.shtml Jimmy James Kyle Babich wrote: What would I use to include external pages in my script? (like if I wanted to print the contents of faq.txt or log.cgi in my script) Is there a way to do the above except to include a php script instead of a txt file and have both the cgi and php function correctly? Thank you, Kyle -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]