Bluehost.com Web Hosting $6.95

Encription

This is a discussion on Encription within the PHP General forums, part of the PHP Programming Forums category; Hi all, i need to encrypt a sensible string to pass it whit GET method. I need that to be ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-30-2008
Stefano Esposito
 
Posts: n/a
Default Encription

Hi all,

i need to encrypt a sensible string to pass it whit GET method. I need
that to be decriptable (to use the string in the receiving script) and
not to be base64 (too easy to decript)... is there anything similar,
considering that my host hasn't installed the Pear::Crypt_GPG package?
(actually, it hasn't installed Pear at all).

Thanks for you hints :)

Ciao,
Stefano


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Motostorm.it vendita online di abbigliamento moto caschi ed accessori delle migliori marche a prezzi scontati
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7846&d=30-6
Reply With Quote
  #2 (permalink)  
Old 06-30-2008
Will Fitch
 
Posts: n/a
Default RE: [PHP] Encription

Have you considered mcrypt then base64?

-----Original Message-----
From: Stefano Esposito [mailto:ragnarok@email.it]
Sent: Monday, June 30, 2008 2:37 PM
To: php-general@lists.php.net
Subject: [php] Encription

Hi all,

i need to encrypt a sensible string to pass it whit GET method. I need
that to be decriptable (to use the string in the receiving script) and
not to be base64 (too easy to decript)... is there anything similar,
considering that my host hasn't installed the Pear::Crypt_GPG package?
(actually, it hasn't installed Pear at all).

Thanks for you hints :)

Ciao,
Stefano


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Motostorm.it vendita online di abbigliamento moto caschi ed accessori delle
migliori marche a prezzi scontati
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7846&d=30-6

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

Reply With Quote
  #3 (permalink)  
Old 06-30-2008
Richard Heyes
 
Posts: n/a
Default Re: [PHP] Encription

> my host hasn't installed the Pear::Crypt_GPG package?
> (actually, it hasn't installed Pear at all).


You can just go to the pear (http://pear.php.net) website and cut/paste
the code (using the same directory structure). There's no requirement to
use the PEAR installer (in fact I don't and never have).

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv
Reply With Quote
  #4 (permalink)  
Old 06-30-2008
Mark Bomgardner
 
Posts: n/a
Default String to date

I need to convert a date retrieved from user input to a mysql date. Here
the problem, I need to convert one of three possible combinations, either
01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's
limited to one character to explode on. I would prefer not to use regexp,
but think I am going to have to. The one part of the code that works below
is using 01/01/2008 format. Any suggestions

echo $olddate = '06/06/2008';
echo "<br />";
echo $olddate2 = '06-16-2008';
echo "<br />";
echo $olddate3 = '06.26.2008';
echo "<br />";
echo $newdate = date("Y-m-d",strtotime($olddate));
echo "<br />";
echo $newdate2 = date("Y-m-d",strtotime($olddate2));
echo "<br />";
echo $newdate3 = date("Y-m-d",strtotime($olddate3));

markb

Reply With Quote
  #5 (permalink)  
Old 06-30-2008
Bastien Koert
 
Posts: n/a
Default Re: [PHP] String to date

On Mon, Jun 30, 2008 at 4:58 PM, Mark Bomgardner <mbomgardner@kletc.org>
wrote:

> I need to convert a date retrieved from user input to a mysql date. Here
> the problem, I need to convert one of three possible combinations, either
> 01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's
> limited to one character to explode on. I would prefer not to use regexp,
> but think I am going to have to. The one part of the code that works below
> is using 01/01/2008 format. Any suggestions
>
> echo $olddate = '06/06/2008';
> echo "<br />";
> echo $olddate2 = '06-16-2008';
> echo "<br />";
> echo $olddate3 = '06.26.2008';
> echo "<br />";
> echo $newdate = date("Y-m-d",strtotime($olddate));
> echo "<br />";
> echo $newdate2 = date("Y-m-d",strtotime($olddate2));
> echo "<br />";
> echo $newdate3 = date("Y-m-d",strtotime($olddate3));
>
> markb
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Your date field should always be the same in the database. The just use the

date function to format that date when displaying to the user...don't alter
the date format as it may make the date field unusable for queries or throw
errors when attempting to insert.


--

Bastien

Cat, the other other white meat

Reply With Quote
  #6 (permalink)  
Old 06-30-2008
Boyd, Todd M.
 
Posts: n/a
Default RE: [PHP] String to date

> -----Original Message-----
> From: Mark Bomgardner [mailto:mbomgardner@kletc.org]
> Sent: Monday, June 30, 2008 3:58 PM
> To: php-general@lists.php.net
> Subject: [php] String to date
>
> I need to convert a date retrieved from user input to a mysql date.
> Here
> the problem, I need to convert one of three possible combinations,
> either
> 01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's
> limited to one character to explode on. I would prefer not to use
> regexp,
> but think I am going to have to. The one part of the code that works
> below
> is using 01/01/2008 format. Any suggestions
>
> echo $olddate = '06/06/2008';
> echo "<br />";
> echo $olddate2 = '06-16-2008';
> echo "<br />";
> echo $olddate3 = '06.26.2008';
> echo "<br />";
> echo $newdate = date("Y-m-d",strtotime($olddate));
> echo "<br />";
> echo $newdate2 = date("Y-m-d",strtotime($olddate2));
> echo "<br />";
> echo $newdate3 = date("Y-m-d",strtotime($olddate3));


Step 1.) Replace all "-" with "/".
Step 2.) Replace all "." with "/".
Step 3.) Err.. wait.. you're done.


Todd Boyd
Web Programmer


Reply With Quote
  #7 (permalink)  
Old 07-01-2008
mike503@gmail.com
 
Posts: n/a
Default Re: [PHP] String to date

couldn't strtotime() do this without any mods? I personally would try
that first...

On 6/30/08, Mark Bomgardner <mbomgardner@kletc.org> wrote:
> I need to convert a date retrieved from user input to a mysql date. Here
> the problem, I need to convert one of three possible combinations, either
> 01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's
> limited to one character to explode on. I would prefer not to use regexp,
> but think I am going to have to. The one part of the code that works below
> is using 01/01/2008 format. Any suggestions
>
> echo $olddate = '06/06/2008';
> echo "<br />";
> echo $olddate2 = '06-16-2008';
> echo "<br />";
> echo $olddate3 = '06.26.2008';
> echo "<br />";
> echo $newdate = date("Y-m-d",strtotime($olddate));
> echo "<br />";
> echo $newdate2 = date("Y-m-d",strtotime($olddate2));
> echo "<br />";
> echo $newdate3 = date("Y-m-d",strtotime($olddate3));
>
> markb
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply With Quote
  #8 (permalink)  
Old 07-01-2008
Stefano Esposito
 
Posts: n/a
Default Re: [PHP] Encription

On Mon, 30 Jun 2008 14:39:04 -0500
"Will Fitch" <fitchwh@gmail.com> wrote:

> Have you considered mcrypt then base64?


Thanks, i was completely forgetting mcrypt... that's what i need :)


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
VOGLIA DI VACANZA ?
* Prenota la tua vacanza in un Costa Hotels!
* Hotels e Agriturismo nella Riviera Romagnola.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8032&d=1-7
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0