sford999 Posted March 27, 2013 Share Posted March 27, 2013 I'm trying to make a payment gateway for my script but i`m having a problem with the output The code // redirect to the payment gateway $desc = urlencode($days.' days extension for '.$username); $sign = calculateWidgetSignature($params, $secret_key); $gatewayUrl = 'http://paymentprocessor.com/gateway?'; $gatewayUrl .= 'key='.$app_key.'&'; $gatewayUrl .= 'uid='.$userId.'&'; $gatewayUrl .= 'widget='.$widget.'&'; $gatewayUrl .= 'amount='.$amount.'&'; $gatewayUrl .= 'currencyCode='.$ccode.'&'; $gatewayUrl .= 'ag_name='.$desc.'&'; $gatewayUrl .= 'ag_external_id='.$days.'&'; $gatewayUrl .= 'ag_type=fixed&'; $gatewayUrl .= 'ag_period_length='.$days.'&'; $gatewayUrl .= 'ag_period_type=day&'; $gatewayUrl .= 'ag_recurring=0&'; $gatewayUrl .= 'sign_version=2&'; $gatewayUrl .= 'sign='.$sign; The problem is when I echo/print the $gatewayUrl I get the following http ://paymentprocessor.com/gateway?key=random_string&uid=1&widget=p4_1&amount=10¤cyCode=USD&ag_name=30+days+extension+for+username&ag_external_id=30&ag_type=fixed&ag_period_length=30&ag_period_type=day&ag_recurring=0&sign_version=2&sign=random_string The highlighted part in red is stopping the code from working as its meant to say "¤cyCode" not ¤cyCode Link to comment https://forums.phpfreaks.com/topic/276242-building-urls-help/ Share on other sites More sharing options...
jazzman1 Posted March 28, 2013 Share Posted March 28, 2013 Replace all "&" symbols with its a html entity name "&" $gatewayUrl .= 'key='.$app_key.'&'; http://www.utexas.edu/learn/html/spchar.html Are you planning to use this url in javascript? Link to comment https://forums.phpfreaks.com/topic/276242-building-urls-help/#findComment-1421532 Share on other sites More sharing options...
sford999 Posted March 28, 2013 Author Share Posted March 28, 2013 Thanks i now it was an amatur mistake And no, Its not going to be used in javascript Link to comment https://forums.phpfreaks.com/topic/276242-building-urls-help/#findComment-1421544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.