Encoding text

2002-09-21 Thread Mike Craig

Hi,

I want to encode a string using the translate function.

decoding is well documented by

$value =~ tr/+/ /;
$value = s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;

what i would like to do is to use the translate command to replace just the
special chars into hex encoding %??

My quess was to try and convert all chars that are not normal chars but I
am not sure how to do this.

Your suggestions will be appreciated.

Best regards

Mike


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




RE: text/area editing

2002-09-21 Thread Ramon Hildreth

Hi, my cgi compiles on the command line, but I get an internal server error
when
I try to access in the browser

use strict;
use warnings;

my $file_name='';
my $content='';
$file_name = 'testfile';

open TEXT, $file_name or die "couldn't open '$file_name' for reading: $!\n";

while () {

$content .= $_;
}

print<

http://www.ramonred.net/cgi-bin/text.cgi";>
$content


EOF
# end of text.cgi

I have made sure the permissions are set correctly.
Any ideas what could be wrong?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
zentara
Sent: Saturday, September 21, 2002 10:01 AM
To: [EMAIL PROTECTED]
Subject: Re: text/area editing


On Sat, 21 Sep 2002 06:04:56 -0700, [EMAIL PROTECTED] (Ramon Hildreth)
wrote:

>Hi,
>I would like to create a form that loads text into a text/area box for
>editing. So far in the books that I have
>I only see how you can post that is added to the text/area only. In my case
>I would like the html or cgi page to load
>with the text/area box already containing text.
>

print<

http://www.example.com/foo.cgi";>
4 score and 7 years
ago.



EOHTML


--
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: Database Normalization ?

2002-09-21 Thread Janek Schleicher

Mmkhajah wrote at Sat, 21 Sep 2002 13:20:14 +0200:

>  I wonder if it's better to use database normalization solution when dealing with 
>Flat Files databases ?

And your Perl-CGI question is ... ?

It's a good question,
but I think you better should ask it in a database newsgroup.

The only answer I can give you in the sort is,
it depends 
(on your specific problem, we don't know).


Greetings,
Janek


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




Re: text/area editing

2002-09-21 Thread zentara

On Sat, 21 Sep 2002 06:04:56 -0700, [EMAIL PROTECTED] (Ramon Hildreth)
wrote:

>Hi,
>I would like to create a form that loads text into a text/area box for
>editing. So far in the books that I have
>I only see how you can post that is added to the text/area only. In my case
>I would like the html or cgi page to load
>with the text/area box already containing text.
>

print<

http://www.example.com/foo.cgi";> 
4 score and 7 years
ago.



EOHTML


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




Re: Creating thumbnails (Newbie Question)...

2002-09-21 Thread Randal L. Schwartz

> "Joel" == Joel Hughes <[EMAIL PROTECTED]> writes:

Joel> After you have install image magick, the basic syntax is...


Joel>   use Image::Magick;
Joel>   $p = new Image::Magick;
Joel>   $p->Read(..your main image...);

Joel>   $p->Scale(width=>$required_width, height=> $required_height);

Joel>   $p->Write(..your scaled image...)

Joel> your only trickyish part is keeping the projection right when
Joel> you scale the image, however, for a start, the above code can
Joel> get you going.

No, it's not tricky.  Unless you work really hard at it, your image
is always scaled in proportion, such that the width and the height
fit a maximum of the sizes listed above.  It's just (dare I say) magic!

Let me illusrate:  if an image is 75x150, and you ask for a 25x25 version,
you get a 12x25 version, which is the same proportions, but both
numbers are smaller than 25.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> 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]




Re: MD5 & SHA-1

2002-09-21 Thread zentara

On Sat, 21 Sep 2002 10:29:25 +1000, [EMAIL PROTECTED] (Jimmy
George) wrote:

>I thought 'encryption' was supposed to make the data transmitted from
>user to server into an unreadable block of garbage. Able to be decoded
>by the server of course - but of no use to any one else who tapped into
>the transmission or the file stored on the server.
>
>So what's the go? How does SSL make such things as credit card details
>secure?? 

An https connection is totally encrypted. No one on the network in
between can see the raw data.  The data is encrypted with the
server certificate, and you should be able to look at what certs
you have with your browser.

>The spiel I have just read talks about a 'digest' but all that
>is doing is verifying that the information you sent to the user is
>coming back unaltered.
>
>Why send data to a user for them to send back to you? How do I mangle a
>credit card number and decode at my end???
You don't need to if using https. If you are not using https, you should
not be taking credit cards. However, once the cc number gets into
your server, you should encrypt it before writing it to disk, so others
on the system, can't accidently read them.

The reason people send data to users, just to send it back, and have it
verified, is to prevent the "user" from playing tricks. What is someone
make an order for 1 widget, at an agreed upon price, you send the
page for user verification, and they edit the page to a lower price, and
send it back.  You need to keep track of what is what. There are
other ways of doing this, but they involve writing to disk files to
"save the state" of the transaction.  The above method saves you
the trouble of writing to disk, until the transaction is finalized.











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




text/area editing

2002-09-21 Thread Ramon Hildreth

Hi,
I would like to create a form that loads text into a text/area box for
editing. So far in the books that I have
I only see how you can post that is added to the text/area only. In my case
I would like the html or cgi page to load
with the text/area box already containing text.

Is there a good book that someone could recommend that would cover this? Or?
thanks.




 ramon hildreth
www.ramonred.net




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




Database Normalization ?

2002-09-21 Thread MMKHAJAH

Hello Everyone,
 I wonder if it's better to use database normalization solution when dealing with Flat 
Files databases ?