Re: Urgent help - Token Generation code!

From: Date: Sat, 28 May 2011 07:06:28 +0000
Subject: Re: Urgent help - Token Generation code!
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-313186@lists.php.net to get a copy of this message
Let me try and get back. Thanks, Jasper! On 28-May-2011, at 4:29 AM, Jasper Mulder <lord_farin@hotmail.com> wrote:
----------------------------------------
From: shreyasbr@gmail.com To: lord_farin@hotmail.com Subject: Re: [PHP] Urgent help - Token Generation code! Date: Sat, 28 May 2011 04:15:59 +0530 Jasper, Tried echoing $sToken but wouldn't work. Regards, Shreyas On 28-May-2011, at 4:11 AM, Jasper Mulder wrote:
----------------------------------------
Date: Sat, 28 May 2011 03:56:26 +0530 From: shreyasbr@gmail.com To: php-general@lists.php.net Subject: [PHP] Urgent help - Token Generation code! I am re-visiting the world of PHP after a really big hiatus and I am finding things veryslippery. Can someone please help me with the below code and let me know how I can print the token that is getting generated? I am using EasyPHP and I am trying to echo the $token but it wouldn't print anything. I am trying it as : http://localhost/token/URLToken.php. May I know where all I am going wrong here in my approach?
$sUrl = "/tstd_c_b1@s54782"; $sParam = "primaryToken"; $nTime = time(); $nEventDuration = 86400; $nWindow = $nTime + $nEventDuration; $sSalt = "akamai123!"; $sExtract = ""; // optional
As a second try, what happens if you add right here the line $sGen = urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime); Because it seems as though you just declare three functions in the code without calling them...
function urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime) { $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt, $sExtract, $nTime); echo $token;
There are two cases: 1. You made a typo and meant 'echo $sToken;' on the above line instead 2. You omitted the part where $token is defined and used
[More code that seemed fine] -- Regards, Shreyas Agasthya
Best regards, Jasper Mulder


« previous php.general (#313186) next »