denoteone Posted September 13, 2010 Share Posted September 13, 2010 having issues with echo curl_setopt($ch, CURLOPT_POSTFIELDS,"name='. $name .'&email='. $email .'&macs='.$mac_addresses.'&serial=".$serialnumber); the thing is $mac_addresses is a serialized array that should look like this 4a:4:{i:0;s:14:"98340234820384";i:1;s:16:"0980342883408230";i:2;s:11:"72843729374";i:3;s:16:"4209384082304980";} but when I unserilize $mac_addressed and echo it I get \'.a:4:{i:0;s:14:\"98340234820384\";i:1;s:16:\"0980342883408230\";i:2;s:11:\"72843729374\";i:3;s:16:\"4209384082304980\";}.\' can anyone see what my issue is? Link to comment https://forums.phpfreaks.com/topic/213267-issue-with-variable-in-post-string/ Share on other sites More sharing options...
GKWelding Posted September 13, 2010 Share Posted September 13, 2010 you're using an incorrect mix of single and double quotes, do either one or the other, not both: url_setopt($ch, CURLOPT_POSTFIELDS,'name='. $name .'&email='. $email .'&macs='.$mac_addresses.'&serial='.$serialnumber); or url_setopt($ch, CURLOPT_POSTFIELDS,"name=$name&email=$email&macs=$mac_addresses&serial=$serialnumber"); Link to comment https://forums.phpfreaks.com/topic/213267-issue-with-variable-in-post-string/#findComment-1110527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.