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

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.

131 Like 22 Dislike
Previous php-forum Next php-forum
Other php-forum

Is it possible to put an entire 500-page book in a database with PHP?
I am working on an intranet and I was wondering if its possible to code php with mysql to enter a fu

Undefined index: username HELP NEWBIE
I am trying a simple login/logout for my website. It works well with checking if the username exists

FILTER_CALLBACK -- Files?
Hi All,

I'm using the php filter functions to validate my form data. For custom filters, I'm

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

Open browser page depending on XML results
Hello,

I have some PHP code that sends webbased from data to an external url ( in the form of

php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum

Standard DES encryption script?
Can anybody point me to a tutorial or a short script that shows how to encrypt some text with salt i

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)
in my mysql db u

Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitesp

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