This is just an initial observation / question, but why are you running every step through rawurlencode? Look at the definition of the function - every time you run it on a string it will encode everything non numeric except -_.~ ... so if you run it once and it returns %20 for example and you run it again on that string, that %20 will become like %blah%20 or whatever. If it were me, I would not have any rawurlencode in your sign function. Build your query string in plain ole English, like you are typing into the browser, then right before you send it you encode it. Or better yet use curl_escape.
FarrisFahad commented: Yay +12
Dani commented: Creative solution! +34
gottaloveit 44 Newbie Poster