Custom 500 Error Script

2003-01-07 Thread Webmaster
Please forgive me if this isn't entirely a perl question.  I am able to use
the .htaccess file on my server to forward any 500 errors to a custom script
to handle them.  I'm trying to create a script that notifies me when a user
gets a 500 error message (at least while still in beta).  What I am finding
is that when the .htaccess file forwards the user to the custom script (in
this case, 500.cgi), I can't collect the name of the page (or the query
string) of the page that caused the 500 error.  $ENV{HTTP_REFERER} returns
the page that the user clicked the link or submitted the form from, and
$ENV{SCRIPT_NAME} returns 500.cgi.

Does anybody have any ideas on how to collect the name of the malfunctioning
script?

Thanks,

Todd



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




Re: Prints the code

2003-01-07 Thread Phill
Thanks for your reply.
The problem was apparently with vqServer using the Sun JVM(which I have
here) I could have changed and used
Microsoft's JVM, but I installed the Apache server instead.
Who knows what is wrong on my Linux partition, hm here I go again.

Craig Dean [EMAIL PROTECTED] wrote in message
20030105152406.VIBJ26296.imf14bis.bellsouth.net@there">news:20030105152406.VIBJ26296.imf14bis.bellsouth.net@there...
 remove .exe from the shebang line. should be #!/usr/bin/perl
 Windows does not use this line
 You must setup perl in IIS. If you are using Active State
 It tells you how to do this in the docs ActivePerl FAQ subheading Windows
 Specific
 The line you need to add is .pl C:\perl %s %s
 .pl is the extension of your CGI scripts this could also be .cgi
 You need to add one line for every extension
 C:\perl is the path to perl.exe where ever you have that installed
 Good Luck
 Perl is very deep and wide
 On Sunday 05 January 2003 06:09 am, Phill wrote:
  Hi there
 
  I am having trouble getting  my first Perl(CGI)scripts
   to work, Im very new to Perl and CGI.  When I run
   the following code in a browser it shows the code and
   not just Hello world! as it should. Im running WinXP
   and I am using VQServer. I dont believe it is a problem
   with finding the interpreter because the exact same thing
   happens when I go to my other partition on my HD and
   try to run it on Linux 8.0.
 
 
  #!/perl/bin/perl.exe
   print Content-type:text/html\n\n;
 
  print EndOfHTML;
   htmlheadtitleTest Page/title/head
   body
   h2Hello, world!/h2
   /body/html
 
  EndOfHTML
 
Any help is appreciated
  Phill.



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




Re: Selecting a Static HTML page

2003-01-07 Thread LRMK
Use this code
this is better than previouse one it does not change action
this one directly change Window location

Here is code
--
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.FormName1.SelectName.selectedIndex;
window.location.href=urls[nChosen];
return(false);
}

//--
/SCRIPT






body
Try this codepnbsp;/p
form  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=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: how to print mysql table to text file backup with perl

2003-01-07 Thread fliptop
On Mon, 6 Jan 2003 at 20:44, Hughes, Andrew opined:

HA:That makes a lot of sense.  If I strip out the pipes, tabs, hard returns
HA:etc. going into the database table, do you think that I should be okay not
HA:using the module?

why waste your time?

the csv modules already on cpan do it all for you.  don't reinvent the 
wheel.


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




Re: how to fetch data form line

2003-01-07 Thread Octavian Rasnita
Use LWP::UserAgent module.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message - 
From: uma ramdoss [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 6:03 AM
Subject: how to fetch data form line


let me know how i can fetch data from a webserver and
save it in disk like x.jpg, a.html, y.gif.


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.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: Custom 500 Error page

2003-01-07 Thread Octavian Rasnita
I don't think this is possible because I don't think you could find the
referer of a referer with a script.
The referer  of your 500.cgi script is page b, so ...


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: Webmaster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 12:27 AM
Subject: Custom 500 Error page


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]




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




Re: Custom 500 Error Script

2003-01-07 Thread Todd Farmer
That did the trick, thanks!  Thanks to all who took time to help me out.

Todd

- Original Message -
From: Bob Showalter [EMAIL PROTECTED]
To: 'Webmaster' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 10:47 AM
Subject: RE: Custom 500 Error Script


 Webmaster wrote:
  ...What I am finding is that when the .htaccess file
  forwards the user to the custom script (in this case, 500.cgi), I
  can't collect the name of the page (or the query string) of the page
  that caused the 500 error.

 It should be available in the REDIRECT_URL environment variable. See:

 http://httpd.apache.org/docs/custom-error.html

 Note that your ErrorDocument must not start with http:

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




FW: Cgi Win xp Perl

2003-01-07 Thread Paul Kraus
I am running on a windows xp pro desktop with iis installed. I have
active state Perl installed and have been using it with out a problem. I
just started to play with cgi and I am having a lot of problems getting
it to work right. I have a static html form that's action calls the
following script. When it I hit submit all it does is display it as if
it was a text file. If I rename it to .pl then it tries to download it.
However if I have just call another test cgi script that displays some
html then it runs fine (also named .pl) with one exception it tells me
that it is to late to do -T.

So basically I need to find out how to call this script from my form and
have it execute. Second I need to find out how to get .cgi scripts to
load instead of displaying or trying to download. Third I need to know
how to pass the -t to the compiler before my script executes. (I am
assuming this is a problem with Perl on windows not using the shebang.
Even though -w works odd.)

#!/usr/bin/perl -w
use strict;
use CGI;

my $q=new CGI;
print $q-header (text/plain);
print These are the parameters I received:\n\n;

my ($name, $value);
foreach $name ($q-param){
  print $name:\n;
  foreach $value ($q-param($name)){
print \t$value\n;
  }
}


Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.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]


Post Method versus Get Method

2003-01-07 Thread Susan Aurand
I know the POST Method the data is sent to STDIN, and GET method the data is attached 
to the URL and
then submitted. When and why would you want to use the GET method versus the POST 
method. Is is
because of  firewalls? or what?  I would appreciate any input on this subject.
Thank You.
Susan Evans



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




RE: Post Method versus Get Method

2003-01-07 Thread wiggins
There are many reasons to choose one or the other. A good one for POST is file 
uploads, where the input values could be very very large (think mega or giga bytes of 
data) or binary which would have to be encoded and then unencoded in some manner, 
whereas this is less of a problem over a stream.

POST however requires more user interaction, that is submitting a form, etc. Where a 
GET is just a simple link, which makes building dynamic sites easy, for instance where 
a CGI prints links to a page that is different for each user, rather than requiring 
each of those links to be a form, a user can just click, and they unknowingly just 
submitted a GET to a CGI that then generates another dynamic page (sure this can be 
done with cookies but who needs the hassle, and there is a limit to how many and how 
large cookies can be).

This is a rather broad question and generally makes more sense with experience

http://danconia.org


On Tue, 07 Jan 2003 16:17:36 -0500, Susan Aurand [EMAIL PROTECTED] wrote:

 I know the POST Method the data is sent to STDIN, and GET method the data is 
attached to the URL and
 then submitted. When and why would you want to use the GET method versus the POST 
method. Is is
 because of  firewalls? or what?  I would appreciate any input on this subject.
 Thank You.
 Susan Evans
 
 
 
 -- 
 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]




Open2 Spawn-Waitpid()

2003-01-07 Thread bh-horse Salto


Ok here is what i have
:
the error msg that the script prints afther it have reached 64 processes is:

open2: IO::Pipe: Can't spawn-NOWAIT: Resource temporarily unavaliable at
msg_cracker.pl line 443 

the part of the code is this
}

close TEMPFILE;

} elsif ($Param[1] eq '2wayproc') {

$ExtPid = open2(*ExtReader, *ExtWriter, $TempValue );

shout ('debug',OPEN2: Two-way process with PID $pid spawned.);

select(ExtWriter); $| = 1; select(STDOUT);

}

return;

A friend of mine told me that he did this to his code..

Suppose you run the child process in a loop like I did :

LOOP: while (condition) {

eval { $pid = open2($FHFROM,$FHTO,$Exe,@Params); };
if ($@) {
# then there is an open2() error and error code/message is in $@
}

unless (defined $pid) {
# then the child could not be started for some reason
}


# Now we talk to the child, the child does whatever it has to do and stops

# When we're done ..
# Close up our pipes, collecting status on the way
# By the way, I don't know on which close() we collect the status,
documentation doesn't say
unless (close $FHTO) {
$status = $?  8; # get program exit code ?
# etc...
}
unless (close $FHFROM) {
$status = $?  8; # get program exit code ?
# etc...
}

sleep 1; # give it time to exit (maybe)

# And here is the essential part to avoid the Resource not available.. 
error
:
# waitpid() cleans that child process's remainders out of the process table,
# which otherwise fills up and eventually leads to the resource not 
available
error

$status = waitpid($pid,0);
# I suppose should also get the child exit code in $status


} # end while LOOP


BUT i changed some thngs to use in my prog but it did not work...

Please can someone help me
Thnaks




_
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com


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