RE: [PHP] GD Lib

2002-07-09 Thread Dave MacRae

 Hi there;
 
 I installed Apache2.0.39 and PHP4.2.1 on RedHat Linux 7.2. The 
 installation
 procedure is fine. The php installation inlcude gd and some 
 extension, but I
 can't find the php-gd.so on my computer.
 
 Anybody can help?

Looks like the problem is that you haven't installed GD. 

Dave

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP PGP

2002-05-24 Thread Dave MacRae

 This is not what I need.
 I'm not building a userbase to authenticate with.
 
 I'm holding a database of users and passwords that I need to keep.
 There is no authentication done against these user/password pairs.
 
 I don't want to keep the passwords in free text since if someone 
 breaks in, 
 he can steel many users and passwords.
 
 What I want to do, is encrypt each password with another password.
 and be able to decrypt the string with the same pass that was used
 to encrypt to show the original plain text pass two who ever needs
 to see it.

The problem here is that to be able to decrypt a password you will have 
to store the key somewhere. This key will then be vulnerable if someone
breaks into your machine. In other words, the crack becomes a bit more 
difficult but will have the same catastrophic affects.

What you should do is encrypt the password in the database using a one way
function, such as crypt(), http://www.php.net/manual/en/function.crypt.php.

When the user enters their password, encrypt that and then compare the
encrypted passwords. The only problem with this is that there is no easy
way to recover the password if the customer loses it. In this scenario, you
will have to have an alternative way to reset the customers password.

Regards

Dave

--
Chief Technical Consultant
Auxinet Payment Services   http://www.auxinet.com
Phone: +44 870 72 74 76 2 Sales Office: +44 870 72 74 76 3
Fax:   +44 870 72 74 78 2   +44 870 72 74 78 3
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Null character as field seperator in a string.

2002-04-29 Thread Dave MacRae

For historic reasons, I have a file that contains a number of records in
which the fields are seperated by the NULL character, i.e, 

field1\0field2\0field3\0field4

I need to parse out the fields from this string.

The string is read into the program using 

$buffer = fgets(...).

This would be no problem in Perl or C but I cannot get this to work in PHP.

I have tried using 

preg_split(/\0/, $buffer);

But this fails. I've tried walking through the string but it seems that
$buffer only has the content up to the first NULL character.

Does anyone have a simple solution to this problem.

Regards

Dave

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Null character as field seperator in a string.

2002-04-29 Thread Dave MacRae


 Hey..

 yeah I might..


 I don't know if I am right or just blabbering crap

 but try to add these param's to your regex statement..


 preg_split(/\0/i, $buffer);


 note the i.. It should let it read past newlines.. although you're prob is
 with null (\0) chars..


 as I said.. Don't know if I am on the right track.. but it's
 worth a go eh??

Unfortunatly I get the message

Warning: No ending delimiter '/' found in  when I try this. It appears
that PHP is interpreting the \0 as a string terminator for the pattern match
:(

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Null character as field seperator in a string.

2002-04-29 Thread Dave MacRae


 On Monday 29 April 2002 18:26, Dave MacRae wrote:
  For historic reasons, I have a file that contains a number of records in
  which the fields are seperated by the NULL character, i.e,
 
  field1\0field2\0field3\0field4
 
  I need to parse out the fields from this string.
 
  The string is read into the program using
 
  $buffer = fgets(...).
 
  This would be no problem in Perl or C but I cannot get this to
 work in PHP.
 
  I have tried using
 
  preg_split(/\0/, $buffer);
 
  But this fails. I've tried walking through the string but it seems that
  $buffer only has the content up to the first NULL character.

 Try using fread() to get your file (it's binary safe). Then use:

   explode(chr(0), $buffer);

 to separate your fields.

I'm beginning to think this may be the only solution.

I now have to figure out how to process the records as I'm looking for the
data in a particular line in the file, this should be fairly easy.

Thanks.

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php