cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

CURL & Session IDs

From: William Thomsen <w.p.thomsen_at_gmail.com>
Date: Sun, 22 Jul 2007 02:23:50 -0400

Right now I'm running a multi_curl, but it still takes about 20 seconds to
run. I have a "loading" page which has this multi_curl script on it, but I
would like to also have a link on that page which lets the user end the
multi_curl execution and just parse out the results that have been retrieved
thus far. Is this possible?

The way I'm thinking right now, is to use one php session id and pass it to
each url that I use curl on. Then each url that is processed would just
write data to the session, which could then be read by any page.

The problem is, the script I'm using hangs. I don't think it is possible to
open simultaneous connections of the same sessionid. Here is an example of
what I'm trying to do...

test.php:

<?php
session_start();

$s = session_id();
$url = 'http://www.vegashotelhunt.com/test2.php?PHPSESSID='.$s;

$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 $output = curl_exec($ch);
 curl_close($ch);

$finalvariable = $_SESSION['sidtest'];
echo $finalvariable;
?>

test2.php:

<?php
session_start();
$test = 'If you can read this on test.php, success!!';
$_SESSION['sidtest']=$test;
?>

Any help would be greatly appreciated.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-07-22