Re: add new piece of html code in perl not success:internal server error

2002-12-19 Thread Mystik Gotan
$var = qq(img src=https://www.paypal.com/images/x-click-but6.gif; 
border=0
name=submit alt=Make payments with PayPal - it's fast, free and secure!
/form);

Or no qq, and then quotemeta($var);

perldoc -f quotemeta

Btw, you forgot img in the beginning :)

--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]




From: eric [EMAIL PROTECTED]
Reply-To: eric [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: add new piece of html code in perl not success:internal server 
error
Date: Thu, 12 Dec 2002 02:04:22 -0700

Dear perl users:

  I want to copy a piece of html code to my site,

src=https://www.paypal.com/images/x-click-but6.gif; border=0
name=submit alt=Make payments with PayPal - it's fast, free and 
secure!
/form

tthen it just show nothing( a piece of white) then I tried to put \ before
every 

then it have errror,
Internal Server ERror

  I know it is just this piece of new code make ghost.

  Please help

Sincere Eric
www.linuxspice.com
linux/window pc for sale


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


_
Chatten met je online vrienden via MSN Messenger. http://messenger.msn.nl/


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




Re: solved (was Re: any idea to solve this problem?)

2002-12-17 Thread Mystik Gotan
$| is a system-variabele for buffering. With 1, you're activcating it.

--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]





From: Admin-Stress [EMAIL PROTECTED]
To: perl cgi [EMAIL PROTECTED]
Subject: solved (was Re: any idea to solve this problem?)
Date: Tue, 17 Dec 2002 07:52:25 -0800 (PST)

Hi,

It solved by putting this codes for flushing cgi output :

   $|=1;
   sleep 5;

It was suggested by someone.
Anyone can explain, what does $|=1 means?

kapot

--- Larry Coffin [EMAIL PROTECTED] wrote:
 I was wondering if I can 'flush' the cgi operation, so in 
SAVE_CONFIG.PL
 will be like this :

   Ok Configuration saved.;
 
   flush_cgi_operation;
   # so, cgi output is written in the user browser

 	How about just closing STDOUT -- 'close(STDOUT);'? That should
 close the filehandle and flush the output. Whether that results in the
 output getting pushed on through to the web client and the connection 
being
 closed or not may depend on the server software you are using.

 	---Larry


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


_
Ontvang je Hotmail  Messenger berichten op je mobiele telefoon met Hotmail 
SMS http://www.msn.nl/jumppage/


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



Re: Pass an NT IIS env variable to apache UNIX cgi ??

2002-12-12 Thread Mystik Gotan
Personally, I'd write them to a file and them get them. That doesn't leave 
you with installing modules and so on. Plus you can get a good overview. But 
this is just my way.

--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]





From: Kipp, James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Pass an NT IIS env variable to apache UNIX cgi ??
Date: Wed, 11 Dec 2002 09:32:36 -0500

hopefully i can explain this correctly:
I have a cgi script that users from NT workstations will access. the script
runs on IIS server, so I am able to grab the remote user name, like this:
(my $user = lc($ENV{'REMOTE_USER'}) ) =~ s/.*?\\//;
$user will match the users account name on a UNIX server.
How can i pass this variable to a cgi script that will run on Apache/UNIX
server?

Please let me know if further explanation is needed.
Thank You.



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



_
Ontvang je Hotmail  Messenger berichten op je mobiele telefoon met Hotmail 
SMS http://www.msn.nl/jumppage/


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



Re: How to get the biggest integers from an array?

2002-12-10 Thread Mystik Gotan
Oh, no, actually, I know quite about Perl. The problem is, I hardly have got 
any experience in programming, I read a lot. I've got 3 perl books and 
wasn't just thinking at the idea of using sort(). Thanks guys.



--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]





From: Geraint Jones [EMAIL PROTECTED]
To: Mystik Gotan [EMAIL PROTECTED], [EMAIL PROTECTED],   
[EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: How to get the biggest integers from an array?
Date: Tue, 10 Dec 2002 14:39:42 +

Use the sort function:

	print sort @array;

and for largest number first use:

	print reverse sort @array;

For your particular problem:

	@sorted_array = reverse sort @array;
	foreach (@sorted_array)
	{
		# whatever you want to do with each number goes here
	}

This kind of problem is usually covered in most beginners Perl books. Might 
be
wise to invest in one ;-)

On Tuesday 10 December 2002 1:09 pm, Mystik Gotan wrote:
 Hiya,

 I'm in search for a solution. Let's say I have this array:

 @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);

 Now, how can I get the biggest integers from this array and give them a
 string with their place. Let's say I have a foreach loop where I checked
 all the biggest integers (however, I don't know how) and I give them all 
a
 string like:

 $website_76 = 1; # position 1
 $website_87 = 2; # position 2

 --
 Bob Erinkveld (Webmaster Insane Hosts)
 www.insane-hosts.net
 MSN: [EMAIL PROTECTED]




 _
 Ontvang je Hotmail  Messenger berichten op je mobiele telefoon met 
Hotmail
 SMS http://www.msn.nl/jumppage/

--
Geraint Jones

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


_
MSN Zoeken, voor duidelijke zoekresultaten! 
http://search.msn.nl/worldwide.asp


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



Re: script runs in console but not in browser

2002-12-09 Thread Mystik Gotan
In the beginning of your script, put:

print Content-type: text/html\n\n;

This is because the browser need to know what content type is being printed, 
and in the shell all is the same, so you don't need it. Anyway, any web page 
you request is declared with a content type, but this is automatically done 
by HTTP.



--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]





From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: script runs in console but not in browser
Date: Mon, 9 Dec 2002 15:26:35 +0200

Sorry about the vague topic, don't know how to describe the problem.

My code runs OK in the console and does what it is meant to do. In the
browser it doesn't die or give any errors, but only does about half of
what it is meant to do before it magically stops with no errors.

If you look at the below code, it gets as far as:
while ( ( my $store ) =  $sth-fetchrow_array ) {
print OPTION VALUE=\$store\ $store/OPTION\n;
}
Now it falls over during this loop, there about 250 records it needs to
print and stops randomly between the first record and sometimes near the
last. but there are no error messages, the script thinks that it has
done everything. I hope this makes some sense, as i have no idea how to
troubleshoot this problem and all the FAQs and docs mentioned in
perlfaq? don't seem to have answers.

I'm running Perl 5.6.0 with apache 1.3

TIA
Merritt


sub fetch
{
my $dsn   = 'dbi:Pg:dbname=foo;host=172.30.2.253;port=5432';
my $username = bar;
my $password = baz;
# make connection
my $dbh = DBI-connect ($dsn, $username, $password, {
PrintError = 1,
RaiseError = 0
} )
or warn Can't connect to the PG database: $DBI::errstr\n;
# SELECT store
my $sth = $dbh-prepare( 
SELECT  store_number FROM store ORDER BY store_number
 ) or warn SELECT: $DBI::errstrBR;
$sth-execute( ) or warn EXEC: $DBI::errstrBR;
print Store Number:;
print SELECT NAME=\store\\n;
print OPTION SELECTED/OPTION\n;
while ( ( my $store ) =  $sth-fetchrow_array ) {
print OPTION VALUE=\$store\ $store/OPTION\n;
}
print /SELECTBR\n;
# Disconnect from Pg DB
$dbh-disconnect or warn Disconnection Failed: $DBI::errstrBR;
}
 attach3 



_
Chatten met je online vrienden via MSN Messenger. http://messenger.msn.nl/


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




Re: Upload (probably a stupid question)

2002-12-06 Thread Mystik Gotan
$var =~ tr/^\\\w+$//; # replace slashes and words with none, so this
   # kinda leaves you with nothing that the filename.
   # UNTESTED!

I also recommend:
$var =~ s/[^\w.-]/_/g; # which translate's some signs to underscores (_)



--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]






From: Scot Robnett [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Upload (probably a stupid question)
Date: Fri, 6 Dec 2002 10:37:11 -0600

How do I make my script only send the filename rather than the full path
when I use the CGI.pm upload function?

For example, when I upload the document

	test.xls

On the remote server, it's being named with the full path of where I sent 
it
from, like this

	C:\Documents and Settings\SRobnet\Desktop\test.xls

How can I get it to just leave the filename as test.xls on the remote
server without appending my entire local path to it?

-
Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]



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


_
MSN Zoeken, voor duidelijke zoekresultaten! 
http://search.msn.nl/worldwide.asp


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



Guestbook script problem

2002-11-27 Thread Mystik Gotan
Hi.

I'm a young (14, dutch) Perl Programmer (or so however you may call, some 
call me, some might don't ;)). Anyway, I'm getting a 500 error on my script. 
I changed some things, like print content type in subs, and I put the HTML 
form in the script. But no changes for the ISE error. Hope you guys can help 
me :-)


#!usr/bin/perl -wT

use warnings; # use Module warnings (for better error checking)
use CGI; # use Module CGI (enhanced CGI functions)
use strict; # stricter acces for subs, references and vars without scope 
(nice for error trapping)
use Fcntl; # Module used for system operations (mostly UNIX). This is one I 
need for flock()
use vars qw($q, $query_name, $query_email, $query_message);


print Content-type: text/html\n\n; # To let the CGI Interface run, declare 
content-type

# SET VARIABLES !!! #
$use_flock = 0; # set to 0 if you don't use flock(), otherwise use 1

$q = new CGI;
# Parameters: (we will let CGI.PM handle form-processing)
$query_name = $q-param('name');
$query_email = $q-param('email');
$query_msg = $q-param('message');

# prepare file acces
mkdir('messages', 0777); # make directory called message, permissions set to 
ALL ACCES

# CALL SUBROUTINES #
open_file;
write_file;
# END CALL SUBROUTINES #

sub open_file {
   my (@filecontents);
		opendir(MSGDIR, /messages);
			  @files = readdir(MSGDIR);
		close(MSGDIR);

		foreach $file (@files) {
		print Content-type: text/html\n\n;

		  			open(OPENFILE, /messages/$file);

		if ($use_flock == 1) {
			 flock(OPENFILE, LOCK_NB);
		} # use flock() when value set to 1

		@filecontents = OPENFILE;

		if ($use_flock == 1) {
			 flock(OPENFILE, LOCK_UN);
		} # don't use flock() when value set to 0

		close(OPENFILE);
		print__HTML__;
		print STDIN, @filecontents; # actually, you don't need STDIN (I 
think)...
	  __HTML__
		}
} # end open_file

sub write_file {
		print Content-type: text/html\n\n;

		HTML;
		my ($writefile) = msg . $$ . .txt; # construct filename; $$ = process 
ID

		if (defined($query_name, $query_email, $query_message)) {
		$def = 1;
		} else {
		$def = 0;
		}

		if ($def == 1) {
			 open(WRITEFILE, $writefile) or die(Can't open $writefile. \n 
Error:\n $!);
		print WRITEFILE, $query_name;
		print WRITEFILE, $query_email;
		print WRITEFILE, $query_msg;
			close(WRITEFILE);
		} else {
	 print(You did not enter any valid input.\n Please go back to fill 
them in.);
		}
} # end write_file

sub HTML {
printHTML;
html
head
titleGuestbook - Test #0.01 - Beta 0.01/title
/head
body
center
font face=Tahoma
Please fill in a messsage.Brbrbrbr

form method=POST
bName:/b input type=text value=namebr
bEmail:/b input type=text value=emailbrbr
bMessage:/b Brbrtextarea rows=5 cols=25/textareabr
Brbutton type=submitSend Message!/button
/form
/font
center
/body
/html
HTML;
}

1;





--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]




_
Ontvang je Hotmail  Messenger berichten op je mobiele telefoon met Hotmail 
SMS http://www.msn.nl/jumppage/


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



Question about wantarray()

2002-11-26 Thread Mystik Gotan
I can't really figure out what the purpose of wantarray() is.
Can someone please give me a good, decent explanation?

Thanks in advance :-)


--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]




_
MSN Zoeken, voor duidelijke zoekresultaten! 
http://search.msn.nl/worldwide.asp


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