teknojunkey Posted January 17, 2011 Share Posted January 17, 2011 Hi I can get this to work can you point me in the right direction curl_setopt( $ch, CURLOPT_URL, "http://website.com/action=%22getcontent%22%20shipid=%22\"$content\"%22%20/%3E%3C/request%3E"); I want to include the variable $content in the url thanks Link to comment https://forums.phpfreaks.com/topic/224724-add-variable-to-curl-url/ Share on other sites More sharing options...
beegro Posted January 17, 2011 Share Posted January 17, 2011 What is in the variable $content? It looks fine to me but you'll probably need to apply urlencode() to the $content variable if it has any special characters in it. Link to comment https://forums.phpfreaks.com/topic/224724-add-variable-to-curl-url/#findComment-1160745 Share on other sites More sharing options...
teknojunkey Posted January 17, 2011 Author Share Posted January 17, 2011 $content is a number 1234 can you point me in the right direction thanks Link to comment https://forums.phpfreaks.com/topic/224724-add-variable-to-curl-url/#findComment-1160770 Share on other sites More sharing options...
BlueSkyIS Posted January 17, 2011 Share Posted January 17, 2011 you shouldn't need to urlencode a number. but you must remove the quotes from around it. and what is all the %20 stuff? You should use a plain-text. You shouldn't need to do the url-encoding of anything but variables, and not always variables. Link to comment https://forums.phpfreaks.com/topic/224724-add-variable-to-curl-url/#findComment-1160773 Share on other sites More sharing options...
teknojunkey Posted January 17, 2011 Author Share Posted January 17, 2011 sorry for wasting everyone's time there was a typo in the variable Link to comment https://forums.phpfreaks.com/topic/224724-add-variable-to-curl-url/#findComment-1160815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.