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

curl-and-php

PHP + cURL + session id

From: Chris Gralike <Chris.Gralike_at_AMIS.nl>
Date: Wed, 26 Apr 2006 12:21:37 +0200

Hi Luke,

I dont know exactly what is the idea in this script, and all i did was
just "ordering" it a bit and making it readable. Please take a look at
this, try
it out and tell me what "functionality" is missing. There where also
some
weird statements that i "corrected" dont know if you wrote them like
that
intentionaly...

Hope this Works,

Kind regard.

<?php
/**
* file: t1.php
*/
session_start();
// Cant see why u want to "set" a session var without value here, and
should actually give a parse error or e_notice
// At least. And if u like to use it as "visible value" u should set it.

echo "<html><body><a href=\"t2.php\"> 2 >> </a></body></html>";

?>

<?php
/**
  * file: t2.php
  */
session_start();
$_SESSION['user'] = "add some info";

$url=
"http://www.myserver.com/t3.php<http://www.google.com/url?sa=D&q=http://
www.myserver.com/t3.php>"
$ch = curl_init ();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_TIMEOUT, 2);
      curl_setopt($ch, CURLOPT_COOKIE,
session_name()."=".session_id().";");
      $output = "<br/>error no: ".curl_errno($ch)."<br/>error:
".curl_error($ch)."<br/>";
      echo "$output";
      curl_close($ch);
?>

<?php

/**
* file: t3.php
*/
session_start();
if(isset($_SESSION['user'])){
        echo "yeah<br/>";
}else{
        echo "nope<br/>";
}
?>

Met vriendelijke groet,
Chris Gralike
 
AMIS Services BV
Edisonbaan 15
3439 MN NIEUWEGEIN
Postbus 24
3430 AA NIEUWEGEIN
 
T: 030-601-6079
F: 030-601-6001
M: Chris.Gralike_at_AMIS.nl
W: http://www.AMIS.nl

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-04-26