| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-and-php Archives
FOLLOWLOCATION as true doesn't seem to work
From: Earl Brown <eabrown_at_csumb.edu>
Date: Sun, 6 May 2012 23:24:18 -0700
PHP curl users,
I can't figure out why I can't get the html source code of:
http://corpusdelespanol.org/x2.asp
even though I can get the source code of:
http://corpusdelespanol.org/x.asp
My PHP script starts at x.asp and gets a cookie and then passes
start of script
<?php
if (empty($_GET['word'])) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_URL,'http://corpusdelespanol.org/x.asp');
curl_exec($ch);
curl_setopt($ch,CURLOPT_URL,'http://corpusdelespanol.org/x1.asp');
curl_exec($ch);
curl_setopt($ch,CURLOPT_URL,'http://corpusdelespanol.org/x2.asp?chooser=seq&p='
$second_page = curl_exec($ch);
echo $second_page . "<br /><br /><br />";
curl_setopt($ch,CURLOPT_URL,'http://corpusdelespanol.org/x3.asp?r=23&w11='
$inpage = curl_exec($ch);
preg_match('|<span ID="w_section">SECTION</span>:
echo str_replace(',', '', $matches[1]);
__________
Instead of giving me what I see as the source of x2.asp in a browser,
HTTP/1.1 302 Object moved
HTTP/1.1 200 OK
I have assumed FOLLOWLOCATION as true would fix this problem, but it
Thank you for your help. Best, Earl Brown
-- Earl K. Brown, PhD Chair, Language ULR Committee Assistant Professor of Spanish Linguistics School of World Languages and Cultures California State University, Monterey Bay _______________________________________________ http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-phpReceived on 2012-05-07 These mail archives are generated by hypermail. |
Page updated January 05, 2012.
web site info