/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function apiSig($vars) { $sig = ""; foreach ( $vars as $n => $v ) $sig .= $n.$v; $sig .= $GLOBALS["apiSecret"]; //echo "<h1>".$sig.$GLOBALS["apiSecret"]."</h1>"; } function builtUrl($vars, $sig) { $url = $GLOBALS["apiRootUrl"] . "?"; foreach ($vars as $n => $v) $url .= $n . "=" . $v . "&"; if($sig==1) $url .= "api_sig=".apiSig($vars); return $url; }