Selecting a Static HTML page

2003-01-06 Thread Hagen Finley
I am just beginning to experiment with CGI. Currently I have a list of 10 
storage arrays (EMC or XP) in a static page with a hyperlink from each to a 
static page which provides information about their configuration. As the list 
grows this approach will become increasingly cumbersome. Therefore, my 
initial modest goal is to use the SELECT tag to offer the users a pull down 
list of storage devices which will simply function like the links in the 
existing static HTML page. I have examined both the Lincoln Stein and the 
O'Reilly CGI books and neither appear to speak directly to this type of 
action. All of their examples seem to want me to dynamically create a new 
HTML page based on the user's selection. That is the direction I am headed 
but it is not the intial goal to which I am striving.
After hours of  groping around I did find a syntax that kind of works - 

FORM ACTION=array1.html METHOD=GET

I figure if I variablize the file name then the select tag could input the 
file name I need into this FORM ACTION statement. Is that the way to do this 
or is there a preferrable method?

Regards,

Hagen Finley
Walnut Creek, CA

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Selecting a Static HTML page

2003-01-06 Thread drieux

On Monday, Jan 6, 2003, at 08:41 US/Pacific, Hagen Finley wrote:
[..]


	After hours of  groping around I did find a syntax that kind of works 
-

FORM ACTION=array1.html METHOD=GET

I figure if I variablize the file name then the select tag could input 
the
file name I need into this FORM ACTION statement. Is that the way to 
do this
or is there a preferrable method?
[..]

actually that 'action' element will need to be the
name of the cgi code that will know what to do with
the selection

	form action=SelectHost.cgi method=POST target=_top
		select name=sysname size=1
			option value=linux1linux1/option
			option value=sun1sun1/option
		/select
	/form

that will return

	sysname=linux1

if the user does not scroll through the menu...

Remember that 'raw html files' - foo.html - do not parse
the query strings handed to them in the 'GET|POST' methods...


ciao
drieux

---


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Selecting a Static HTML page

2003-01-06 Thread LRMK

Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
:[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
- Original Message -
From: LRMK [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 12:48 AM
Subject: Re: Selecting a Static HTML page



 Variabalizing the action will get the job done but
 best will be using a cgi to do it because you can
 process some other input data with cgi
 if u r not using cgi then u can only forward to another static page


 Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
 :[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
 - Original Message -
 From: drieux [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: cgi cgi-list [EMAIL PROTECTED]
 Sent: Monday, January 06, 2003 10:41 PM
 Subject: Re: Selecting a Static HTML page


 
  On Monday, Jan 6, 2003, at 08:41 US/Pacific, Hagen Finley wrote:
  [..]
  
   After hours of  groping around I did find a syntax that kind of works
   -
  
   FORM ACTION=array1.html METHOD=GET
  
   I figure if I variablize the file name then the select tag could input
   the
   file name I need into this FORM ACTION statement. Is that the way to
   do this
   or is there a preferrable method?
  [..]
 
  actually that 'action' element will need to be the
  name of the cgi code that will know what to do with
  the selection
 
  form action=SelectHost.cgi method=POST target=_top
  select name=sysname size=1
  option value=linux1linux1/option
  option value=sun1sun1/option
  /select
  /form
 
  that will return
 
  sysname=linux1
 
  if the user does not scroll through the menu...
 
  Remember that 'raw html files' - foo.html - do not parse
  the query strings handed to them in the 'GET|POST' methods...
 
 
  ciao
  drieux
 
  ---
 
 
  --
  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]




how to print mysql table to text file backup with perl

2003-01-06 Thread Hughes, Andrew
I have a mysql table with about 3000 rows of data on which that I need to
perform a daily backup.  Because I am on a shared hosting account I do not
have administrative rights to the database.  To back it up currently I have
a script that prints each line of data to the browser delimited with pipes
using this code:


$stmt = qq { select * from 2002brochurecontest };
$sth = $dbh-prepare ($stmt);
$sth-execute ();
$count = 0;
while (my $row = $sth-fetchrow_hashref())
{
print
$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$row-{w
_phone_ext}|$row-{division}|$row-{email}|$row
-{eclub}|$row-{country}|$row-{brochure}|$row-{purchase},
br();
}
$sth-finish();

I take the output and print it to my browser.  Then I cut and paste it into
a text file.  To avoid this extra step and to learn something new, I would
like to print the data to a text file.  Each day I would just overwrite the
same text file with the data, so I would not have to create a new file every
time the script runs.  Can anyone point me in the right direction?

Thanks,
Andrew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how to print mysql table to text file backup with perl

2003-01-06 Thread LRMK
where do you want to save your file
on your PC or on the server

Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
:[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
- Original Message -
From: Hughes, Andrew [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 12:58 AM
Subject: how to print mysql table to text file backup with perl


 I have a mysql table with about 3000 rows of data on which that I need to
 perform a daily backup.  Because I am on a shared hosting account I do not
 have administrative rights to the database.  To back it up currently I
have
 a script that prints each line of data to the browser delimited with pipes
 using this code:


 $stmt = qq { select * from 2002brochurecontest };
 $sth = $dbh-prepare ($stmt);
 $sth-execute ();
 $count = 0;
 while (my $row = $sth-fetchrow_hashref())
 {
 print

$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$row-{w
 _phone_ext}|$row-{division}|$row-{email}|$row
 -{eclub}|$row-{country}|$row-{brochure}|$row-{purchase},
 br();
 }
 $sth-finish();

 I take the output and print it to my browser.  Then I cut and paste it
into
 a text file.  To avoid this extra step and to learn something new, I would
 like to print the data to a text file.  Each day I would just overwrite
the
 same text file with the data, so I would not have to create a new file
every
 time the script runs.  Can anyone point me in the right direction?

 Thanks,
 Andrew

 --
 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]




Re: HTML in perl autoresponders

2003-01-06 Thread LRMK
yes adding
'Content-Type: text/html'  header must get the job done




- Original Message -
From: Damian Wader [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 1:26 AM
Subject: HTML in perl autoresponders


 I created an autoresponder with perl. Click Here to view the code. However
I
 would like body of the message to reflect HTML code which I cannot get it
to
 do. My server does not work with the mime::lite module so I already know
 about that but is there any other way?

 A. Damian Wader
 www.endlessfollowup.com




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Autoresoponders with Perl

2003-01-06 Thread LRMK
Adding that Content-Type: text/html line
after the

print MAIL Subject: Your catalog request.\n\n;

line must work



- Original Message -
From: Damian Wader [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 1:35 AM
Subject: Autoresoponders with Perl


 somehow the link did not work so here is the URL for the code of my
previous
 message:

 I created an autoresponder with perl. Here is the code:
 http://www.farinfrared.com/efuwelcome.cgi.txt

 However I would like body of the message to reflect HTML code which I
cannot
 get it to do. My server does not work with the mime::lite module so I
 already know about that but is there any other way?

 A. Damian Wader
 www.endlessfollowup.com


 --
 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]




Re: Selecting a Static HTML page

2003-01-06 Thread drieux

On Monday, Jan 6, 2003, at 10:50 US/Pacific, LRMK wrote:
[..]

Variabalizing the action will get the job done but
best will be using a cgi to do it because you can
process some other input data with cgi
if u r not using cgi then u can only forward to another static page

[..]

could you provide an illustration of this?

I presume you mean to use some javascripting???


ciao
drieux

---


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to print mysql table to text file backup with perl

2003-01-06 Thread Hughes, Andrew
Thanks so much.  I got some help offline that did the trick.

The suggestion that worked was to do the following:

my $filename = out.txt;
open(OUTFILE,$filename);
 $stmt = qq { select * from 2002brochurecontest };
 $sth = $dbh-prepare ($stmt);
 $sth-execute ();
 $count = 0;
 while (my $row = $sth-fetchrow_hashref())
{
print OUTFILE
$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$row-{w
_phone_ext}|$row-{division}|$row-{email}|$row
-{eclub}|$row-{country}|$row-{brochure}|$row-{purchase}\n;
 }
$sth-finish();
close(OUTFILE);

Thanks,
Andrew

-Original Message-
From: LRMK [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 2:16 PM
To: Hughes, Andrew; [EMAIL PROTECTED]
Subject: Re: how to print mysql table to text file backup with perl


where do you want to save your file
on your PC or on the server

Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
:[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
- Original Message -
From: Hughes, Andrew [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 12:58 AM
Subject: how to print mysql table to text file backup with perl


 I have a mysql table with about 3000 rows of data on which that I need to
 perform a daily backup.  Because I am on a shared hosting account I do not
 have administrative rights to the database.  To back it up currently I
have
 a script that prints each line of data to the browser delimited with pipes
 using this code:


 $stmt = qq { select * from 2002brochurecontest };
 $sth = $dbh-prepare ($stmt);
 $sth-execute ();
 $count = 0;
 while (my $row = $sth-fetchrow_hashref())
 {
 print

$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$row-{w
 _phone_ext}|$row-{division}|$row-{email}|$row
 -{eclub}|$row-{country}|$row-{brochure}|$row-{purchase},
 br();
 }
 $sth-finish();

 I take the output and print it to my browser.  Then I cut and paste it
into
 a text file.  To avoid this extra step and to learn something new, I would
 like to print the data to a text file.  Each day I would just overwrite
the
 same text file with the data, so I would not have to create a new file
every
 time the script runs.  Can anyone point me in the right direction?

 Thanks,
 Andrew

 --
 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]




Re: Selecting a Static HTML page

2003-01-06 Thread LRMK

Sign L Rakhitha Malinda Karunarathne Web :- rakhitha.cjb.net Email
:[EMAIL PROTECTED] Rakhitha Malinda Karunarathne.
- Original Message -
From: drieux [EMAIL PROTECTED]
To: LRMK [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 2:05 AM
Subject: Re: Selecting a Static HTML page



 On Monday, Jan 6, 2003, at 10:50 US/Pacific, LRMK wrote:
 [..]
  Variabalizing the action will get the job done but
  best will be using a cgi to do it because you can
  process some other input data with cgi
  if u r not using cgi then u can only forward to another static page
 [..]

 could you provide an illustration of this?

 I presume you mean to use some javascripting???


 ciao
 drieux

 ---




My code is ass follows



html

head
titleNew Page 1/title
/head



script language=JavaScript
!--
function doit(){
urls=new Array();
urls[0]=http://www.yahoo.com;;
urls[1]=http://www.hotmail.com;;
urls[2]=http://www.perl.org;;
var nChosen = document.FormName.SelectName.selectedIndex;
document.FormName.action=urls[nChosen];
return(true);
}

//--
/SCRIPT






body
Try this codepnbsp;/p
form  name=FormName onsubmit=doit()
  pselect size=1 name=SelectName
  option selectedwww.yahoo.com/option
  optionwww.hotmail.com/option
  optionwww.perl.org/option
  /selectinput type=submit value=Submit name=B1input type=reset
value=Reset name=B2/p
/form

/body

/html




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: HTML in perl autoresponders

2003-01-06 Thread LRMK
It works
U just have to use html formating tags when u send text
massage to the MAIL program after adding thet content type
like this




print MAIL  PrintTag;
p align=leftbDear $in{'custname'}:/bp
palign=left
Welcome to a href=http://www.EndLessFollowUp.comEndLessFollowUp.com!/a
In the next comingbr
days you will be exposed to such new and innovative ways to br
build your online or traditional business, you will be bonkingbr
yourself in the head. However what is really going to astonishbr
you is how fundamental, easy to impliment and innexpensive br
they are to utilize. /p
palign=left
If you are a self starter you will need nothing more then thisbr
bFREE REPORT/b  to get you sarted but if you want more youbr
can always schedule your 1hour bFREE CONSULTATION!/b/p

palign=leftGood Luck and don't hesitate to email me with any
questions!/p

palign=lefta
href=http://www.endlessfollowup.comwww.endlessfollowup.com/a
Damian Wader/p

PrintTag



-

try replacing your massage with above

- Original Message -
From: Damian Wader [EMAIL PROTECTED]
To: LRMK [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 2:41 AM
Subject: Re: HTML in perl autoresponders


 Unfortunately that is not getting the job done and I don't know why.

 A. Damian Wader
 www.endlessfollowup.com




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Fw: Selecting a Static HTML page

2003-01-06 Thread LRMK




Use this codethis is better than previouse one it does not 
change actionthis one directly change Window locationHere is 
code--htmlheadtitleNew 
Page 1/title/headscript 
language="_javascript_"!--function doit(){urls=new 
Array();urls[0]="http://www.yahoo.com";urls[1]="http://www.hotmail.com";urls[2]="http://www.perl.org";var 
nChosen = 
document.FormName1.SelectName.selectedIndex;window.location.href="">return(false);}//--/SCRIPTbodyTry 
this codepnbsp;/pform name="FormName1" 
onsubmit="return doit()" pselect size="1" 
name="SelectName" option 
selectedwww.yahoo.com/option 
optionwww.hotmail.com/option 
optionwww.perl.org/option /selectinput 
type="submit" value="Submit" name="B1"input 
type="reset"value="Reset" 
name="B2"/p/form/body/html
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: HTML in perl autoresponders

2003-01-06 Thread Randal L. Schwartz
 Damian == Damian Wader [EMAIL PROTECTED] writes:

Damian I created an autoresponder with perl.

If you autorespond to me, you better darn well not send HTML, but just
plain text.  HTML email is evil.

Damian  Click Here to view the code.

That doesn't work here.  This mailing list enforces plain text email,
so your HTML branch was stripped.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Custom 500 Error page

2003-01-06 Thread Webmaster
I use a shared hosting account that allows me to customize error messages
using a .htaccess file.   What I would like to have happen is for my custom
script (500.cgi) to be able to send an email to me (at least during beta)
about the problem.  I'm finding that when the user submits data on page A to
page B, which has an error and forwards the user to 500.cgi, I can't pull
data for page B out of the %ENV data.  $ENV{SCRIPT_NAME} returns 500.cgi
and $ENV{HTTP_REFERER} returns page A.  Is there any way for me to find the
name of the offending script (page B) and the corresponding query string?
Is there something I can add to the .htaccess file that would supply that?

Thanks,

Todd



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to print mysql table to text file backup with perl

2003-01-06 Thread fliptop
On Mon, 6 Jan 2003 at 15:11, Hughes, Andrew opined:

HA:my $filename = out.txt;
HA:open(OUTFILE,$filename);
HA: $stmt = qq { select * from 2002brochurecontest };
HA: $sth = $dbh-prepare ($stmt);
HA: $sth-execute ();
HA: $count = 0;
HA: while (my $row = $sth-fetchrow_hashref())
HA:{
HA:print OUTFILE
HA:$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$row-{w
HA:_phone_ext}|$row-{division}|$row-{email}|$row
HA:-{eclub}|$row-{country}|$row-{brochure}|$row-{purchase}\n;
HA: }
HA:$sth-finish();
HA:close(OUTFILE);

that's fine, but what if your data contains pipes?  you should look into 
one of the csv modules on cpan.  here's one i've used in the past with 
good success:

http://search.cpan.org/author/JWIED/Text-CSV_XS-0.23/CSV_XS.pm

by default, it uses a comma, but you can specify any character to use as 
the delimiter.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to print mysql table to text file backup with perl

2003-01-06 Thread Hughes, Andrew
That makes a lot of sense.  If I strip out the pipes, tabs, hard returns
etc. going into the database table, do you think that I should be okay not
using the module?

My gut response to my own question is not to assume anything.

Thanks,
Andrew

-Original Message-
From: fliptop
To: Hughes, Andrew
Cc: [EMAIL PROTECTED]
Sent: 1/6/2003 6:21 PM
Subject: RE: how to print mysql table to text file backup with perl

On Mon, 6 Jan 2003 at 15:11, Hughes, Andrew opined:

HA:my $filename = out.txt;
HA:open(OUTFILE,$filename);
HA: $stmt = qq { select * from 2002brochurecontest };
HA: $sth = $dbh-prepare ($stmt);
HA: $sth-execute ();
HA: $count = 0;
HA: while (my $row = $sth-fetchrow_hashref())
HA:{
HA:print OUTFILE
HA:$row-{id}|$row-{t}|$row-{f_name}|$row-{l_name}|$row-{w_phone}|$
row-{w
HA:_phone_ext}|$row-{division}|$row-{email}|$row
HA:-{eclub}|$row-{country}|$row-{brochure}|$row-{purchase}\n;
HA: }
HA:$sth-finish();
HA:close(OUTFILE);

that's fine, but what if your data contains pipes?  you should look into

one of the csv modules on cpan.  here's one i've used in the past with 
good success:

http://search.cpan.org/author/JWIED/Text-CSV_XS-0.23/CSV_XS.pm

by default, it uses a comma, but you can specify any character to use as

the delimiter.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]