Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-17-2013, 08:15 PM   PM User | #1
Sim
New Coder

 
Join Date: Feb 2009
Posts: 81
Thanks: 1
Thanked 1 Time in 1 Post
Sim is an unknown quantity at this point
curl postback script

I am trying to make part of my script send some data to another page. It doesn't seem to be working correctly. It connects to the URL it is suppose to, but it doesn't post the fields.

My code:
PHP Code:
                $postvars='';
                
$sep='';
                foreach(
$fields as $key=>$value
                { 
                   
$postvars.= $sep.urlencode($key).'='.urlencode($value); 
                   
$sep='&'
                }

                
$ch curl_init();
                
curl_setopt($ch,CURLOPT_URL$row['site_postback']);
                
curl_setopt($ch,CURLOPT_POST,count($fields));
                
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
                
$result curl_exec($ch);
                
curl_close($ch); 
Any idea's how to post the fields?
__________________
Online RPG Creator - Create Your Own Online RPG with no programming knoweldge
Sim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:40 AM.


Advertisement
Log in to turn off these ads.