I want to use curl to retrieve a table from an external page. So far my code retrieves all data from the page. I have read that using preg_match or preg_replace is the way to go about it.
This is my code so far:
<?php
$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,"http://www.megaupload.com/?d=XE30L1GA&w=631&a...
I using url to request remote urls that sometimes may very slow or just down.
In this case, my php scripts still waiting for the response, it makes apache has to many requests stay in memory and then overload.
I need a way to stop curl requesting or stop running php script when specified time passed.
I'd tried declare(), it makes no sens...
How can I screen scrape a website using cURL and show the data within a specific div?
...
Hi
My web hosting provider does not permit to use curl FOLLOWLOCATION option so I'm trying to
do it manually by using the header function.
My problem is that I need to keep my PHP script running and to be able to get the redirected URL data for parsing.
How do I do that?
...
UPDATE: SOLVED
Hi all, i've got it, just save cookie
to temp file, and resubmit form with
curl and set cookies with previous
temp file :) thanks all for respond :)
Hi all,
i'm create some script to submit content via php curl. first fetch session and captcha, and user must submit captcha to final submit.
the problem is i c...
Hi!
I would like to send pictures via a program written in C + +. - OK
It works, but I would like to send the pictures from pre-loaded carrier to a variable char (you know what I mean? First off, I load the pictures into a variable and then send the variable), cause now I have to specify the path of the picture on a disk.
I wanted to w...
Hi
I'm using cUrl(PHP) to post a login request and store response in cookie file.
In my second request I'm passing cookie in header and post data to verify it.
Issue is that cookie file is not created in first succesful request results in failure for second request. Please suggest me where I'm doing wrong.
$cookiefile="/var/www/html/di...
I'm writing an identi.ca client, and seems that @reply isn't working.
After investigation I found that @ prefix is used by curl to indicate file upload, and escaping with \@reply doesn't work; curl doesn't remove the \ at the front.
I also can't format the postfields to query string, as I need to send files on that request too.
Is the...
Im using the Twitter API to collect the number of tweets I've favorited, well to be accurate the total pages of favorited tweets.
I use this URL: http://api.twitter.com/1/users/show/username.xml
I grab the XML element 'favorites_count'
For this example lets assume favorites_count=5
The Twitter API uses this URL to get the favorties:...
I need to add authentication to this function:
function multiRequest($data, $options = array()) {
// array of curl handles
$curly = array();
// data to be returned
$result = array();
// multi handle
$mh = curl_multi_init();
// loop through $data and create curl handles
// then add them to the multi-handle
foreach ($...
Hello
I want to make use of an API but it print alot of info and i don't know how i can get a few key values of the array.
<?php
$query = "SELECT * FROM kvk WHERE adres='Wit-geellaan 158'";
$host = "http://api.openkvk.nl/php/";
$url = $host ."/". rawurlencode($query);
$curl = curl_init();
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, ...
I'm attempting to use wget with the -p option to download specific documents and the images linked in the HTML.
The problem is, the site that is hosting the HTML has some non-html information preceding the HTML. This is causing wget to not interpret the document as HTML and doesn't search for images.
Is there a way to have wget stri...
I'm trying to get a remote RSS through proxy and parse it.
I'm using magpierss, but it doesn't allow reaching internet through a proxy (or I don't know how to do it).
I assume the option is to, first, fetch the rss with curl functions, that allows proxy authenticating, but ....
are there any class to do this in a easy way, or ... does...
I'm trying to download an html file with curl in bash. Like this site:
http://www.registrar.ucla.edu/schedule/detselect.aspx?termsel=10S&subareasel=PHYSICS&idxcrs=0001B+++
When I download it manually, it works fine. However, when i try and run my script through crontab, the output html file is very small and just says "Object ...
Hi can anyone help me how to select a specific div from the content of a webpage.
Let's say i want to get the div with id="wrapper_content" from webpage http://www.test.com/page3.php.
My current code looks something like this: (not working)
//REG EXP.
$s_searchFor = '@^/.dont know what to put here..@ui';
//CURL
$ch = curl_init()...
i am fetching somesite page..
but it display nothing
and url address change.
example i have typed
http://localhost/sushant/EXAMPLE_ROUGH/curl.php
in curl page my coding is=
$fp = fopen("cookie.txt", "w");
fclose($fp);
$agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0';
$ch = curl_init();
...
I wrote a PHP CUrl Class, if i execute Methods which should return the Content, it returns at first the Headers and after that the Content. So i cant parse any XML Data.
I need to Disable This Sample Output.
HTTP/1.1 200 OK
Date: Thu, 01 Apr 2010 20:11:58 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2....
I'm trying to add a user (by variable $id) to a Twitter List using PHP CURL, and I can't get it to work.
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "http://twitter.com/username/list/members.xml");
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "id=$id")...
I'm using the following code:
$agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, "www.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = cur...
I am attempting to use cURL to connect to a page like this: https://clients.mindbodyonline.com/asp/home.asp?studioid=851 with the following code;
<?php
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'https://clients.mindbodyonline.com/asp/home.asp?studioid=851');
//curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
cur...