Page 1 of 1

PHP $_GET with signature and Pair-Key-Id

Posted: Thu Jul 07, 2011 6:26 am
by momo_8888
hi guys,

I stored media records in one of secured servers when I ask for alink to the media I receive the following link

url?flv=dfdffdfdf?Expires=3344 &jpg=mmmm?expires=222&mp4?expires=111&Signature=dkksdkskdskdsjkdskd&Signature=slldklksdlkld&Signature=30443034-030&Key-Pair-Id=9384jekjdj&key-Pair-Id=04kfkkfl-4-4&key-Pair-Id=043o4lldl;l;flf
I recieved 3 signatures and 3 Pair-Key-Ids and I need to match them together to fetch the data ,

[text]The problem in retrieving the signature and Pair-Key-Id from $_GET[] it returns the last signature and key .
Do any one of you has an idea on how to fetch the 3 Signatures and keys from $_GET
[/text]

Re: PHP $_GET with signature and Pair-Key-Id

Posted: Thu Jul 07, 2011 6:58 am
by social_experiment
Do the key id values correspond with the signature values, the first signature requires the first key id, the second signature requires the second key id, etc?

Re: PHP $_GET with signature and Pair-Key-Id

Posted: Thu Jul 07, 2011 8:18 am
by momo_8888
Yes That's exactly what is should happened and it is as you like ,
If i did it manually it works , but the actual problem is
$sig=$_GET['Signature']; //show the last signature in URL
$sig=$_GET['Signature1']; //wrong index
$sig=$_GET['Signature'][1]; //it give me the letters in the string

I need to fetch the first signature and second signature and third signature with 3 key-ids to match them .

Thanks

Re: PHP $_GET with signature and Pair-Key-Id

Posted: Thu Jul 07, 2011 10:07 am
by AbraCadaver
You can't get anything but the last variable with a query string like that because the variables cannot have the same name. You would need to use an array in the query string, like:

Signature[]=dkksdkskdskdsjkdskd&Signature[]=slldklksdlkld&Signature[]=30443034-030&key-Pair-Id[]=9384jekjdj&key-Pair-Id[]=04kfkkfl-4-4&key-Pair-Id[]=043o4lldl;l;flf

Then you can get $_GET['Signature'][0] etc... You might want to urlencode the [] so %5B%5D.