Jump to content

issue with variable in post string.


denoteone

Recommended Posts

 

 

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.