Bonjour,

J'utilise cette class glaner par ici et par ailleurs (cumul de bout de code..), toutefois, cette dernière fait le job . Par contre, je n'arrive pas a récupérer et afficher en dehors de cette class,
ces 3 variables qui dans la class, affichent bien un résultat

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
                                                        $httpcode = curl_getinfo($this->_url, CURLINFO_HTTP_CODE);
							$redirectedUrl = curl_getinfo($this->_url, CURLINFO_EFFECTIVE_URL);
							$CurlErr = curl_error($this->_url); // Définir le bug.....
 
							echo "HTTP code: $httpcode <br>";
							echo "Redirection: $redirectedUrl <br>";
							echo "ErreurCurl: $CurlErr <br>";
Ce code dans la class

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
 
	                              class checkstatus 
					{
						protected $_url = null;
						protected $_headers = array();
						protected $_body = '';
 
						public function __construct($url,$referer='') 
						{
							$this->_url = curl_init($url);
 
							curl_setopt($this->_url, CURLOPT_URL, $url);
 
							  $header = Array();
							  $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; 
							  $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; 
							  $header[] = "Cache-Control: max-age=0"; 
							  $header[] = "Connection: keep-alive"; 
							  $header[] = "Keep-Alive: 300"; 
							  $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; 
							  $header[] = "Accept-Language: fr-FR,fr;q=0.5"; 
							  $header[] = "Pragma: "; // browsers keep this blank. 
 
 
								curl_setopt($this->_url, CURLOPT_VERBOSE, true);
								curl_setopt($this->_url, CURLOPT_RETURNTRANSFER, 1);
								curl_setopt($this->_url, CURLOPT_AUTOREFERER, 1);
								curl_setopt($this->_url, CURLOPT_HEADER, 0);
								curl_setopt($this->_url, CURLOPT_HTTPHEADER, $header);
								curl_setopt($this->_url, CURLOPT_USERAGENT, 'je teste'); 
								curl_setopt($this->_url, CURLOPT_FOLLOWLOCATION, 1);
								curl_setopt($this->_url, CURLOPT_CONNECTTIMEOUT ,5); 
								curl_setopt($this->_url, CURLOPT_TIMEOUT, 20);
 
								curl_setopt($this->_url, CURLOPT_MAXREDIRS, 5);
								curl_setopt($this->_url,CURLOPT_REFERER,$referer); 
								curl_setopt($this->_url, CURLOPT_HEADERFUNCTION,array($this, 'readHeaders'));
 
							$output = curl_exec($this->_url);
 
							$httpcode = curl_getinfo($this->_url, CURLINFO_HTTP_CODE);
							$redirectedUrl = curl_getinfo($this->_url, CURLINFO_EFFECTIVE_URL);
							$CurlErr = curl_error($this->_url); // Définir le bug.....
 
							echo "HTTP code: $httpcode <br>";
							echo "Redirection: $redirectedUrl <br>";
							echo "ErreurCurl: $CurlErr <br>";			
 
							//curl_close($ch);
 
							}
                                                               public function __destruct() 
								{
									curl_close($this->_url);
								}
 
								public function getHeaders() 
								{
									$this->_body = curl_exec($this->_url);
									return $this->_headers;
								}
 
								public function getBody() 
								{
									return $this->_body;
								}
 
								public function getInfo($info_type) 
								{
									$info = curl_getinfo($this->_url );
									return $info[$info_type];
								}
 
								protected function readHeaders($url, $str) 
								{
									if (mb_strlen($str) > 0) 
									{
										$this->_headers[] = $str;
									}
									return mb_strlen($str);
								}
 
						}
Dès lors, comment récupérer ces 3 variables ailleurs dans ma page ? Ainsi , je pourrai travailler avec des conditions selon le résultat récupéré

D'avance merci pour votre aide/exemple.

Yule