Weird Problem with curl while sending data


Posted on 16th Feb 2014 07:03 pm by admin

I am facing a weird problem with sending data to a site via curl.

If i send the value by this

Did you know?Explore Trending and Topic pages for more stories like this.
Code: $data1="action=capt&tm=1256956853&tmhash=074144d43b5e2fcf34607221bd51b69dded08475&wait=30&waithash=7772647b09ec9995fc3c92d9f04be89029f80564";
curl_setopt($ch2, CURLOPT_POSTFIELDS,$data1);
It works in the above case but however if I send the values like this

Code: $data="action=".$action."&tm=".$tm."&tmhash=".$tmhash."&wait=".$wait."&waithash=".$waithash;
curl_setopt($ch2, CURLOPT_POSTFIELDS,$data);
It won't work.
Here I set $data1 from the value of $data only by getting its output on screen. So $data1 and $data are same.
Just the difference is that $data is in form of variables which I get using preg_match.
I use preg_match to get values of action,tm,tmhash and all that.
No comments posted yet

Your Answer:

Login to answer
131 Like 22 Dislike
Previous forums Next forums
Other forums

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

generate seo frienly url from a text like wordpress
Convert: "åäö" to "aao", "space" to "-", "!?&q

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

Attempt to assign property of non-object in...
I'm having issues with the following function in PHP 5...

function getTreeWithChildre

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Applet JTextField Size Problem
Hello,

I recently started making an applet to calculate certain values for airplanes. However

Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well.
The &quo

Simple program to copy files between two computers over the web
I use logmein free and often need to move files between my two computers. Generally, I move the file

Hyperlink in PHP to MySQL record
Hello,

I am having trouble as i am new to php. I have connected to the database and I have di

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash