| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | Can anyone advise on Curl? I've managed to figure out how to convert an fopen command in the past but this one stumps me.If anyone can assist in coming up with a usable curl command it would be greatly appreciated.It comes from cp_email script. `````````````````````````````````````````````````` ````````` $filepointer = fopen($url,"r"); if($filepointer){ while(!feof($filepointer)){ $buffer = fgets($filepointer, 4096); $file .= $buffer; } fclose($filepointer); } else { die |
| |
| | #2 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | Pulled this from one of my old scripts, maybe you can hack at it... PHP Code:
__________________ |
| |
| | #3 (permalink) |
| NamePros Regular | SecondVersion has the basics above. Basically what you have to do is initialize the curl sesison, set the options, then execute the command. The most difficult portion is setting the options. PHP Code: If you want to DISPLAY the results, then don't set it (or set it to 0). If you want to CAPTURE the data for processing and store it in a variable, you MUST set the "RETURNTRANSFER" variable to 1. If you want to POST data to a URL (i.e. like you were posting info from a form), then you need to build the query string in a loop- something like: PHP Code: Here is one example I had that interacts with Authorize.net: PHP Code: Good luck! -Bob
__________________ The mass purge has begun. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Php Module help (cUrl) / Alternative | squirrelbacon | Programming | 2 | 12-01-2005 08:15 AM |
| Need help with curl install will pay NP | dreaminginspiration | Programming | 5 | 11-19-2005 01:00 AM |
| Newbie looking for advise. | napalm747 | Website Development | 8 | 06-11-2005 07:31 AM |
| Need Advise! | patches | Domain Name Discussion | 1 | 04-22-2005 10:35 AM |
| Registrar Question.. please advise | Wanda | Domain Name Discussion | 4 | 09-15-2004 04:20 PM |