Writable dirs

2004-06-15 Thread Jan Eden
Hi, a friend of mine uses a certain directory to upload files to. This directory has write permissions for all, since his cgi script has to store the files in it. He does not believe that this could be a security issue. Is there a simple method to delete something from this directory (or write

RE: Writable dirs

2004-06-17 Thread Jan Eden
Thanks to Brian, Wiggins and Bill, Spindler, Brian wrote on 15.06.2004: >What is the directory on the server? Is it visible to the outside >world? sorry for not answering your hints for so long. Yes, the dir is below the webserver's document root. I will try using PUT and DELETE to get into

Re: popup_menu item select

2004-06-21 Thread Jan Eden
Hi, Werner Otto wrote on 18.06.2004: >Hi All, > >When I select an item in a popup_menu it needs to print "Hello". In >other word how do I get the name param from the popup_menu by >selecting a value only and not by posting in the form of a submit >button. > I believe this can be done with JavaScr

Re: CGI problem

2004-07-30 Thread Jan Eden
Hi Jane, Sun, Jian wrote on 29.07.2004: >Dear Beginner-cgi: >I used a CGI program to load a HTML form page as shown below, >After I filled the form and submit, the results is just attached to >the initiated form page when it leads to the new webpage. My >question is: how can I load to a new HTML

Re: path/executable question

2004-07-30 Thread Jan Eden
Hi Sean, Sean Davis wrote on 30.07.2004: >I have a script that queries a database and then uses GraphViz.pm to >generate png output based on the query. GraphViz calls executables >located in /usr/local/bin. This runs fine from the command line and >produces a functional png output. However,

Re: How to display a Text file using web browser under CGI

2004-08-13 Thread Jan Eden
Hi Jian, Sun, Jian wrote on 10.08.2004: >Dear all; >Could anybody help me to figure out How to display a Text file using the web >browser in a CGI program? > >Thanks in advance >Jian > Try this: #!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; print $q->header(-type=>'text/htm

Executing pdflatex via CGI script

2004-10-17 Thread Jan Eden
Hi, I wrote a script which takes some info from the user and generates a form letter. The script is run locally for five users, so security is not that important (although it is always important, I know). The script manages to write data to my output file if I created it first and chmodded it

Re: Executing pdflatex via CGI script

2004-10-18 Thread Jan Eden
Hi Gunnar, Gunnar Hjalmarsson wrote on 17.10.2004: >Jan Eden wrote: >>The script manages to write data to my output file if I created it >>first and chmodded it to 666, but fails otherwise. >> >>This is because the script is run by the web user, of course. Is >>t

Output of a command executed by system

2004-10-21 Thread Jan Eden
Hi, this must be simple, but I cannot seem to find it: When executing a command via system within a CGI script, the command's output appears in my browser. I do not use CGI::Carp. How can I suppress this? I tried to redirect the output the shell way ("> /dev/null"), but that did not change a t

Re: Output of a command executed by system

2004-10-21 Thread Jan Eden
Hi Sean, Sean Davis wrote on 21.10.2004: >If the output is to stderr for some reason, you could try ">& >/dev/null". Sorry, there was a typo in my initial attempt to redirect. It works as expected with ">/dev/null". Thanks, Jan -- Common sense is what tells you that the world is flat. -- T

Re: Save as a file

2004-12-15 Thread Jan Eden
Hi Lawrence, Lawrence Statton wrote on 15.12.2004: > > >Here's a trivial example to get you started > >#!/usr/bin/perl >use strict; >use warnings; > >use CGI; > >my $query = new CGI; > >print $query->header(-type => 'text/plain', > content_disposition => 'attachment; filenam

Save as a file

2004-12-15 Thread Jan Eden
Hi, I have some content stored within a database, which I want to be saved as a file on the user's system when requested. Currently, I generate a temporary file (timestamp_fileid.tex) and use a cron job to clean up the directory every 30 minutes: if ($texcontent) { my $texfile = texer(

Re: Save as a file

2004-12-15 Thread Jan Eden
Lawrence Statton wrote on 15.12.2004: >>Hi, >> >>I have some content stored within a database, which I want to be >>saved as a f ile on the user's system when requested. Currently, I >>generate a temporary fi le (timestamp_fileid.tex) and use a cron >>job to clean up the directory every 30 minutes

Re: What exactly does "$| = 1;" do?

2004-12-20 Thread Jan Eden
Hi Todd, Todd W wrote on 16.12.2004: > >"Robert" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> I have seen in a few scripts now, including some of the articles that Mr. >> Schwartz has written. I have read it does something with the buffers but >on >> a more technical level what

To buffer or not ($|)

2004-12-29 Thread Jan Eden
Hi all, I already sent this as a reply to another post, but did not receive an answer. In the following script, the results are not printed at once, line by line, but in one block after several seconds: ___BEGIN CODE___ #!/usr/bin/perl -wT use CGI; use strict; use LWP::UserAgent; my $q = new

Generating a hierarchy path

2005-02-11 Thread Jan Eden
Hi, my database is organized such that every page has a hierarchical superior page ("mother"). When displaying a page, a little drop-down menu should be displayed with all the mother, grandmothers etc. until the loop hits a page of the root type (and unless the page itself is a root page). I c

UNION statement to sort search results

2005-02-14 Thread Jan Eden
Hi, I wrote a search script which can search only the page titles and author names for articles on my site or the titles/authors and the pages' content. To get the results for the two types in two sets, I used a UNION construct: if ($search_string) { my $where_author_title = qq{(authors.l

Perl script and mod_rewrite

2005-03-03 Thread Jan Eden
Hi, I use mod_rewrite to provide simpler URLs for my database-driven site. My document root's .htaccess contains the following line (among others): RewriteRule pages/([0-9]+) cgi-bin/show.pl?id=$1 It works fine. But some of my pages are password-protected, such that show.pl calls the followin

Re: Perl script and mod_rewrite

2005-03-03 Thread Jan Eden
Vladimir D Belousov wrote on 03.03.2005: >just try: > >$q->start_form(-method=>"POST"); > I had done that already. Besides, POST is the default method anyway. Thanks, Jan -- The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners. -- To unsubscribe, e

Re: Perl script and mod_rewrite

2005-03-03 Thread Jan Eden
Vladimir D Belousov wrote on 03.03.2005: >Vladimir D Belousov wrote: > >>just try: >> >>$q->start_form(-method=>"POST"); > > >I'm wrong, sorry. Can I see your .htaccess in part of ModRewrite >directives? Sure (abbreviated): RewriteEngine on RewriteBase / RewriteRule ^news/?$ cgi-bin/show.pl?id=

Re: Perl script and mod_rewrite

2005-03-03 Thread Jan Eden
Vladimir D Belousov wrote on 03.03.2005: >Jan Eden wrote: > >>Vladimir D Belousov wrote on 03.03.2005: >> >> >> >>>Vladimir D Belousov wrote: >>> >>> >>> >>>>just try: >>>> >>>>$q->s

Re: Perl script and mod_rewrite

2005-03-03 Thread Jan Eden
Hi Vladimir, Vladimir D Belousov wrote on 03.03.2005: >Jan Eden wrote: > >>Vladimir D Belousov wrote on 03.03.2005: >> >> >> >>>Vladimir D Belousov wrote: >>> >>> >>> >>>>just try: >>>> >>>&

Query string to URL?

2005-03-07 Thread Jan Eden
Hi, I need to translate a URL with a POST query string into a URL like this: http://mysite.com/pages?id=1234 should become http://mysite.com/pages/1234 I currently use mod_rewrite to turn the initial URL into http://mysite.com/redirect.pl?id=1234 and redirect.pl redirects to http://mysite.com

RE: Query string to URL?

2005-03-07 Thread Jan Eden
Hi Thomas, Thomas Bätzler wrote on 07.03.2005: >>I need to translate a URL with a POST query string into a URL like >>this: >> >>http://mysite.com/pages?id=1234 should become >>http://mysite.com/pages/1234 > >OTTOH: > >RewriteRule ^/pages/([^/]+)/?$/pages?id=$1 [QSA,NS,L] > >Or even easi

RE: Query string to URL?

2005-03-08 Thread Jan Eden
Hi Chris, Chris Devers wrote on 07.03.2005: >On Mon, 7 Mar 2005, Jan Eden wrote: > >> But I need some rule to do this: >> >> http://mysite.com/pages?id=1234 -> http://mysite.com/pages/1234 >> >> And since mod_rewrite does not parse the query strin

RE: Query string to URL?

2005-03-08 Thread Jan Eden
Chris Devers wrote on 07.03.2005: >On Mon, 7 Mar 2005, Jan Eden wrote: > >> But I need some rule to do this: >> >> http://mysite.com/pages?id=1234 -> http://mysite.com/pages/1234 >> >> And since mod_rewrite does not parse the query string, I have a >

Unsticky fields with CGI?

2005-03-11 Thread Jan Eden
Hi, how can I turn off stickiness for CGI's HTML methods. Example: I call a script with parameter "mode=new" and the following line print $q->hidden('mode', 'slurp'); prints out instead of I tried the -nosticky pragma when loading CGI, but it did not change the behaviour. How can I fo

Re: Unsticky fields with CGI? (Sorry)

2005-03-11 Thread Jan Eden
Hi, should have read perldoc *thoroughly*, sorry: >Note, that just like all the other form elements, the value of a >hidden field is "sticky". If you want to replace a hidden field with >some other values after the script has been called once you'll have >to do it manually: > >$query->param('hid

Modify date table

2004-02-07 Thread Jan Eden
Hi all, I want to modify the occupation table for a holiday house. This is my (quite naive) approach: Belegung 2004 15 10 15 20 25 30 Januar   Table cells of class "belegt" appear in red, class "frei" appears in green. Now I have an HTML fo

Re: Modify date table

2004-02-07 Thread Jan Eden
Sorry for double posting, I found the error myself. The script does not have the permission to write to my site. Now the obvious question is: How can I change this? I will try to find out. Thanks, Jan -- There's no place like ~/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Jan Eden
Richard Heintze wrote: >Is there a way I can explictly declare that each array >cell contains a hash? > >Here is the only way I know to do it: > >my @PCEs=[]; >while ($Data->FetchRow()) { > my %dh = $Data->DataHash(); > $PCEs[$cn]{$dh{"id"}} = $dh{"ridPCE"}; >} > >This "my" declaration only says

Re: Modify date table

2004-02-08 Thread Jan Eden
smrtalec wrote: > >>Now the tricky thing: As long as there was an error in my script, it >>was >displayed in >my browser (thanks to CGI::Carp). But as soon as I >eliminated the obvious errors, I >get an Internal Server Error >(testing on my ISP's linux web server and on my local >OS X box, both >

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Jan Eden
Wiggins d'Anconia wrote: >Jan Eden wrote: >>$$PCEs[$cn]{$dh{"id"}} ... >> > >Adding an extra $ here causes Perl to look for $PCEs a scalar, which >doesn't exist rather than dereference the PCEs array. > Ok, I thought of a construction like

Email module

2004-02-09 Thread Jan Eden
Hi, which email module would you recommend? I searched CPAN and found a whole bunch. In CGI Programming with Perl, Mail::Mailer is mentioned, but since the book is a little older, this might not be the best choice. TIA, Jan -- Either this man is dead or my watch has stopped. - Groucho Marx -

Email text encoding

2004-02-11 Thread Jan Eden
Hi, and thanks for all the previous suggestions regarding email modules. Now it turned out that my ISP refuses to let me install *any* additional Perl module on the server, so I have to use sendmail. This is mostly fine, since I only send short text messages, but it breaks down when it comes t

Alternative to Storable

2004-02-12 Thread Jan Eden
Hi all, I just wrote a CGI script using the Storable module, which works fine on my machine. The script retrieves a complex hash and either prints it out or updates it and stores it back. But my ISP does not have Storable installed. Is there a way to install Storable in my home dir on the serv

Re: Alternative to Storable

2004-02-12 Thread Jan Eden
Replying to my own post: Jan Eden wrote: >Hi all, > >I just wrote a CGI script using the Storable module, which works >fine on my machine. The script retrieves a complex hash and either >prints it out or updates it and stores it back. > >But my ISP does not have Storable ins

Re: Alternative to Storable

2004-02-13 Thread Jan Eden
zentara wrote: >On Thu, 12 Feb 2004 17:45:17 +0100, [EMAIL PROTECTED] (Jan Eden) >wrote: > >>Hi all, >> >>I just wrote a CGI script using the Storable module, which works >>fine on my machine. The script retrieves a complex hash and either >>prints

Webhosting with good Perl support

2004-02-14 Thread Jan Eden
Hi all, being unhappy with my ISP's Perl support, I decided to switch. Wiggins and zentara already recommended two providers, Westhost and Affordable Host. Does anyone have an additional recommendation, so I can compare some more? Thank you, Jan -- If all else fails read the instructions. -

Re: Virtual Directory Problem

2004-02-14 Thread Jan Eden
Mallik wrote: >Dear Friends, > >In Apache, the /usr/local/fsuser/sbin directory is mapped to the >virtual directory http://192.168.0.10/fsuser/cgi-bin/. > >>From browser, I am able to access all the .cgi and .pl files >present in the /usr/local/fsuser/sbin and its subdirectories. > >But I am not

Taint mode trouble

2004-02-14 Thread Jan Eden
Hi all, I finally decided to use the taint mode in all my CGI scripts. But I experience a strange problem. The following two lines read a file depending on the parameter 'jahr': my ($jahr) = $q->param('jahr'); my %monate = %{do $jahr} or die $!; This worked. Now, with the -T switch, I have to u

Re: Taint mode trouble

2004-02-14 Thread Jan Eden
Jan Eden wrote: >Hi all, > >I finally decided to use the taint mode in all my CGI scripts. But I >experience a strange problem. The following two lines read a file >depending on the parameter 'jahr': > >my ($jahr) = $q->param('jahr'); my %monate = %{do

Re: Webhosting with good Perl support

2004-02-14 Thread Jan Eden
Casey West wrote: >It was Saturday, February 14, 2004 when Jan Eden took the soap box, >saying: >:Hi all, >: >:Does anyone have an additional recommendation, so I can compare >:some more? > >I'm somewhat partial to pair Networks. :-) > >I think we've got

RE: Taint mode trouble

2004-02-14 Thread Jan Eden
Charles K. Clarkson wrote: > Try: > >$q->param('jahr', ); >my ($jahr) = $q->param('jahr') =~ /\d{4}/; >print $jahr; > >-- >prints: >1 >-- > >Now try it this way: > >$q->param('jahr', ); >( my $jahr = $q->param('jahr') ) =~ /\d{4}/; >print $jahr; > >-- >prints: > Wait a second

Re: OT: Webhosting with good Perl support

2004-02-14 Thread Jan Eden
Frank DeLaTorre wrote: >Yo man, if you read it thread you would get it. The original issue >was between LINUX and OpenBSD...NOT OpenBSD and netBSDGOT IT? > > > > >- Original Message - From: "Robert" <[EMAIL PROTECTED]> To: ><[EMAIL PROTECTED]> Sent: Saturday, February 14, 2004 1:53 PM

utf-8 header in CGI script

2004-04-18 Thread Jan Eden
Hi all, I followed the recent thread on Unicode output, but I still have a question. When writing static XHTML files, I use to indicate the character set. This works fine. But when generating output, this method does not work. I have to use: print $q->header(-type=>'text/html', -charset=>'ut

Re: Interview Questions

2004-04-21 Thread Jan Eden
Hi Mallik, having read your posts over the last two months on beginners-cgi and beginners, I assume you are (just like me) relatively new to Perl. If your request aims at preparing for a job interview as a Perl programmer, I suggest you learn some more Perl before applying. This is not intende

Escaping quotes in variable content

2004-05-11 Thread Jan Eden
Hi all, how can I escape quotes within a variable's content? I use the following directive to fill an HTML form: Unfortunately, if $frage_text contains a double quote, the browser will stop displaying the string at that point. I tried to escape the quotes in a Perl way $frage_text =~ s/"/\\

Re: Escaping quotes in variable content

2004-05-11 Thread Jan Eden
Hi David, David Dorward wrote on 11.05.2004: >On 11 May 2004, at 14:58, Jan Eden wrote: >>how can I escape quotes within a variable's content? I use the >>following directive to fill an HTML form: >name="frage_text" size="100" value="$frage_tex

RE: Escaping quotes in variable content

2004-05-11 Thread Jan Eden
[EMAIL PROTECTED] wrote on 11.05.2004: >> print "http://www.somewhere.com\";>\n"; >> print " > value=\"$frage_text\" />\n"; >> print "\n"; > >This wasn't really the question, but... >If you have to write html within perl, use qq( ) instead of "". >It's a lot easier to read, and much less error

Form mailer and environment variables

2004-04-30 Thread Jan Eden
Hi all, I wrote a little form mail script and start by setting the environment variables like this: BEGIN { $ENV{PATH} = "/usr/sbin"; delete @ENV{ qw( IFS CDPATH ENV BASH_ENV) }; } Now the actual directory (.) is obviously not searched anymore, since my $page_head = eval do('page_head.

Re: Form mailer and environment variables

2004-04-30 Thread Jan Eden
Jan Eden wrote on 01.05.2004: >Hi all, > >I wrote a little form mail script and start by setting the >environment variables like this: > >BEGIN { >$ENV{PATH} = "/usr/sbin"; delete @ENV{ qw( IFS CDPATH ENV BASH_ENV) >}; >} > >Now the actual directory (.

Re: Form mailer and environment variables

2004-05-01 Thread Jan Eden
Wiggins d'Anconia wrote on 30.04.2004: >Jan Eden wrote: >>Hi all, >> >>I wrote a little form mail script and start by setting the >>environment variables like this: >> >>BEGIN { $ENV{PATH} = "/usr/sbin"; delete @ENV{ qw( IFS CDPATH ENV &

Re: Form mailer and environment variables

2004-05-01 Thread Jan Eden
Paul Archer wrote on 30.04.2004: >Tomorrow, Jan Eden wrote: > >>Hi all, >> >>I wrote a little form mail script and start by setting the >>environment variables like this: >> >>BEGIN { $ENV{PATH} = "/usr/sbin"; delete @ENV{ qw( IFS CDPATH E

Re: Form mailer and environment variables

2004-05-01 Thread Jan Eden
Hi guys, I think I found the exact source to my problem: it's the taint mode, as always. From CGI Programming: @INC will not include the current working directory. If your script needs to require or use other Perl code in the current directory, you must explicitly add the current directory to

Apache error 500: malformed header from script

2004-05-02 Thread Jan Eden
Hi all, I initially posted this to the [EMAIL PROTECTED] mailing list, but it seems to be more of a CGI problem. This is the situation: 1. My script (edit.pl) reads a row of data from a database and displays it in an html form for editing. 2. On submitting, the same script is called (in 'commi

Re: Apache error 500: malformed header from script

2004-05-02 Thread Jan Eden
I solved the problem and apologize for the inconvenience. I overlooked a certain print statement which would be sent to the browser before printing a header under certain circumstances. Thanks - Jan Jan Eden wrote on 02.05.2004: >Hi all, > >I initially posted this to the [EMAIL

Re: Not reading the whole file

2004-05-19 Thread Jan Eden
Richard Heintze wrote on 04.05.2004: >I think I solved my own problem. > >I'm using a > >my @backgr_data=; > Or use my $backgr_data = join '', ; - Jan -- There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson -- T

Redirecting

2004-05-19 Thread Jan Eden
Hi all, I wrote a script which operates in various modes (view, edit, commit). Calling the script in edit mode and submitting the resulting html form calls the script in commit mode. Before editing, though, the user has to identify himself. The user name and password are stored in hidden html i

Re: Template

2004-05-24 Thread Jan Eden
Hi Werner, Werner Otto wrote on 24.05.2004: >Hi there, > >How to I include or call another cgi script from a current one. I want to >create say a header script that I just want to include it when I want to. >What does the syntax look like? > >Regards >Otto > How about HTML::Template? It was wr

Re: Requireing a specific sub

2004-05-25 Thread Jan Eden
Hi Otto, Werner Otto wrote on 25.05.2004: >Hi there, > >Is there any way that I can call a specific sub from a cgi script. > >i.e. > >script1.cgi > >sub print1 >{ > print "hello1"; >} > >sub print2 >{ > print "hello2"; >} > >script2.cgi > >my messy code: >require("/home/user/public_html/scrip

Re: Requireing a specific sub

2004-05-25 Thread Jan Eden
Werner Otto wrote on 25.05.2004: >Im lost, could you give me an example, please... > Please cc the list... >On Tue, 25 May 2004 13:13:29 +0200, Jan Eden <[EMAIL PROTECTED]> wrote: > >>Hi Otto, >> >>Werner Otto wrote on 25.05.2004: >> >>>

Re: Only one click please

2004-05-27 Thread Jan Eden
Hi, Naji, Khalid wrote on 27.05.2004: >Hi, there are users who click twice on a control button, how could i >prohibit the double clicks on a button? > Not exactly a CGI solution, but you could utilize the JavaScript ondblclick() event handler to return false in that case. HTH - Jan -- Either