begin process at 2012 05 27 22:10:35
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Class et Objet ( POO )

 > CLASS POUR SOCKETS

CLASS POUR SOCKETS


 Information sur la source

Note :
Aucune note
Catégorie :Class et Objet ( POO ) Classé sous :sockets, class, fonctions, socket, connect socket Niveau :Débutant Date de création :16/02/2008 Date de mise à jour :16/02/2008 23:09:06 Vu :6 052

Auteur : xstyled

Ecrire un message privé
Site perso
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Voici une class pour les sockets permettant la simplification et la compréhension de comment se déroule cette phase.

Rien de particulier à citer mise à part que tout est dans la source.

Source

  • <?php
  • /*
  • --------------------------------------------
  • ---Création: 13 Janvier 2008
  • ---Modification: 16 Février 2008
  • ---Auteur: Romain 'xSTyled' L.
  • --------------------------------------------
  • #vars
  • #public
  • Tableau des erreurs
  • #array errors
  • #private
  • Tableau des nouveaux clients
  • #array newclients
  • Tableau des connexions
  • #array sockets
  • #fonctions
  • #public
  • Ecoute un port [Retourne true si ça a réussi, false sinon]
  • #bool listen ((string) nom, (string) ip, (int) port)
  • Se connecte à une machine distante [Retourne true si ça a réussi, false sinon]
  • #bool connect ((string) nom, (string) ip, (int) port [, (string) localip ])
  • Lit une socket [Retourne la ligne reçue, false si la connexion n'existe pas]
  • #mixed read ((string) nom [, (int) longueur ])
  • Retourne le nom du nouveau client s'il y en a un [false s'il n'y en a pas ou si la connexion n'existe pas]
  • #mixed newclient ((string) nom)
  • Ferme une socket [Retourne true si ça a réussi, false sinon]
  • #bool close ((string) nom)
  • Ecrit sur une socket [Retourne true si ça a réussi, false sinon]
  • #bool write ((string) nom, (string) data, [, (bool) crlf ])
  • Renomme une connexion [Retourne true si ça a réussi, false sinon]
  • #bool rename ((string) nom, (string) nouveau nom)
  • Verifie si une connexion existe [Retourne true si la connexion existe, false sinon]
  • #bool exists ((string) nom)
  • Retourne les infos sur une connexion [Retourne false si la connexion n'existe pas]
  • #mixed infos ((string) nom)
  • #private
  • Retourne le type d'une connexion [false si la connexion n'existe pas ou s'il y a une erreur]
  • #mixed gettype ((string) nom)
  • Retourne le nom d'une connexion avec sa ressource socket. [false si la connexion n'existe pas]
  • #mixed getnamebysocket ((ressource) socket)
  • */
  • class socket {
  • private $sockets = Array();
  • private $newclient = Array();
  • public $errors = Array();
  • public function listen($name, $ip, $port) {
  • $name = strtolower($name);
  • if ($this->exists($name)) {
  • $this->errors[] = 'socket name '.$name.' already exists (line: '.__LINE__.')';
  • return false;
  • }
  • if (!($a = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
  • $this->errors[] = socket_strerror(socket_last_error()).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_set_option($a, SOL_SOCKET, SO_REUSEADDR, 1)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_bind($a, $ip, $port)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_listen($a)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_set_nonblock($a)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • $this->sockets[$name]['sock'] = $a;
  • $this->sockets[$name]['read'] = '';
  • $this->sockets[$name]['ip'] = $ip;
  • $this->sockets[$name]['port'] = $port;
  • $this->sockets[$name]['type'] = 'server';
  • return true;
  • }
  • public function connect($name, $ip, $port, $localip = '0.0.0.0') {
  • $name = strtolower($name);
  • if ($this->exists($name)) {
  • $this->errors[] = 'socket name '.$name.' already exists (line: '.__LINE__.')';
  • return false;
  • }
  • if (!($r = @gethostbyname($localip))) {
  • $this->errors[] = 'Unable to resolve '.$localip.' (line: '.__LINE__.')';
  • return false;
  • }
  • else $localip = $r;
  • if (!($a = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
  • $this->errors[] = socket_strerror(socket_last_error()).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_bind($a, $localip)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_connect($a, $ip, $port)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • if (!@socket_set_nonblock($a)) {
  • $this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
  • return false;
  • }
  • $this->sockets[$name]['sock'] = $a;
  • $this->sockets[$name]['read'] = '';
  • $this->sockets[$name]['ip'] = $ip;
  • $this->sockets[$name]['port'] = $port;
  • $this->sockets[$name]['type'] = 'client';
  • return true;
  • }
  • public function read($name, $length = 1024) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • $a = Array();
  • foreach ($this->sockets as $b => $c) {
  • if (isset($c['sock'])) $a[] = $c['sock'];
  • else unset($this->sockets[$b]);
  • }
  • if (((bool) $a) && (socket_select($a, $write = NULL, $except = NULL, 0) !== false)) {
  • foreach ($a as $b) {
  • if ($this->gettype($this->getnamebysocket($b)) == 'server') {
  • $i = null;
  • $j = null;
  • if ($z = @socket_accept($b)) {
  • $x = (function_exists('mt_rand') ? 'mt_rand' : 'rand');
  • for ($y = chr($x(97,122)).chr($x(97,122)).chr($x(97,122)).chr($x(97,122)); $this->exists($y); );
  • socket_getpeername($z, $i, $j);
  • $this->sockets[$y]['server'] = $this->getnamebysocket($b);
  • $this->sockets[$y]['sock'] = $z;
  • $this->sockets[$y]['read'] = '';
  • $this->sockets[$y]['ip'] = $i;
  • $this->sockets[$y]['port'] = $j;
  • $this->sockets[$y]['type'] = 'serverclient';
  • $this->newclient[$y] = $this->getnamebysocket($b);
  • }
  • }
  • else {
  • $c = @socket_read($b, $length, PHP_BINARY_READ);
  • if ((!strlen($c)) || ($c === false)) {
  • if ($this->sockets[$name]['read'] === false) {
  • if (($d = $this->getnamebysocket($b)) !== false) $this->close($d);
  • else @socket_close($b);
  • return false;
  • }
  • $c = $this->sockets[$name]['read'];
  • $this->sockets[$name]['read'] = false;
  • return $c;
  • }
  • else {
  • if ((($d = $this->getnamebysocket($b)) !== false)) {
  • $this->sockets[$d]['read'] .= $c;
  • }
  • }
  • }
  • }
  • }
  • if ($a =& $this->sockets[$name]['read']) {
  • if (preg_match("/^([^\n]*)[\n](.*)/s", $a, $r)) {
  • $a = $r[2];
  • return str_replace(Array("\r", "\n"), '', $r[1]);
  • }
  • }
  • return '';
  • }
  • public function newclient($name) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • if ($this->gettype($name) != 'server') {
  • $this->errors[] = 'listenqueue: '.$name.' is not a server socket (line: '.__LINE__.')';
  • return false;
  • }
  • if ((bool) $this->newclient) {
  • foreach ($this->newclient as $a => $b) {
  • if ($b == $name) {
  • unset($this->newclient[$a]);
  • return $a;
  • }
  • }
  • }
  • return false;
  • }
  • public function close($name) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • if (isset($this->newclient[$name])) unset($this->newclient[$name]);
  • if (isset($this->sockets[$name]['sock'])) @socket_close($this->sockets[$name]['sock']);
  • unset($this->sockets[$name]);
  • return true;
  • }
  • public function write($name, $data, $lf = true) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' data : '.(ereg('PASS',$data) === 1 ? 'PASS ******' : $data).' (line: '.__LINE__.')';
  • return false;
  • }
  • if ($lf) $data .= "\n";
  • if ((socket_write($this->sockets[$name]['sock'], $data, strlen($data))) === false) return false;
  • return true;
  • }
  • public function rename($name, $newname) {
  • $name = strtolower($name);
  • $newname = strtolower($newname);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • if ($this->exists($newname)) {
  • $this->errors[] = 'Socket name '.$newname.' already exists (line: '.__LINE__.')';
  • return false;
  • }
  • $this->sockets[$newname] = $this->sockets[$name];
  • unset($this->sockets[$name]);
  • return true;
  • }
  • public function exists($name) {
  • $name = strtolower($name);
  • if (isset($this->sockets[$name])) return true;
  • return false;
  • }
  • private function getnamebysocket($sock) {
  • foreach ($this->sockets as $a => $b) {
  • if ($b['sock'] == $sock) return $a;
  • }
  • return false;
  • }
  • private function gettype($name) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • if (isset($this->sockets[$name]['type'])) return $this->sockets[$name]['type'];
  • $this->errors[] = 'Unknow option \'type\' for socket '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • public function infos($name) {
  • $name = strtolower($name);
  • if (!$this->exists($name)) {
  • $this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
  • return false;
  • }
  • $a = Array('ip' => NULL, 'port' => NULL, 'type' => NULL);
  • $b = $this->sockets[$name];
  • if (isset($b['ip'])) $a['ip'] = $b['ip'];
  • if (isset($b['port'])) $a['port'] = $b['port'];
  • if (isset($b['type'])) $a['type'] = $b['type'];
  • if (isset($b['server'])) $a['server'] = $b['server'];
  • return $a;
  • }
  • public final function __construct() {
  • if (!extension_loaded('sockets')) {
  • if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
  • @dl('php_sockets.dll') or die('You must have installed socket extension.');
  • }
  • else {
  • @dl('sockets.so') or die('You must have installed socket extension.');
  • }
  • }
  • }
  • }
  • ?>
<?php
 /*
 --------------------------------------------
 ---Création: 13 Janvier 2008
 ---Modification: 16 Février 2008
 ---Auteur: Romain 'xSTyled' L.
  --------------------------------------------
 #vars
#public
Tableau des erreurs
 #array errors

#private
Tableau des nouveaux clients
 #array newclients
 
Tableau des connexions
 #array sockets
 
 #fonctions
#public
Ecoute un port [Retourne true si ça a réussi, false sinon]
 #bool listen ((string) nom, (string) ip, (int) port)

Se connecte à une machine distante [Retourne true si ça a réussi, false sinon]
 #bool connect ((string) nom, (string) ip, (int) port [, (string) localip ])

Lit une socket [Retourne la ligne reçue, false si la connexion n'existe pas]
 #mixed read ((string) nom [, (int) longueur ])

Retourne le nom du nouveau client s'il y en a un [false s'il n'y en a pas ou si la connexion n'existe pas]
 #mixed newclient ((string) nom)

Ferme une socket [Retourne true si ça a réussi, false sinon]
 #bool close ((string) nom)

Ecrit sur une socket [Retourne true si ça a réussi, false sinon]
 #bool write ((string) nom, (string) data, [, (bool) crlf ])

Renomme une connexion [Retourne true si ça a réussi, false sinon]
 #bool rename ((string) nom, (string) nouveau nom)

Verifie si une connexion existe [Retourne true si la connexion existe, false sinon]
 #bool exists ((string) nom)

Retourne les infos sur une connexion [Retourne false si la connexion n'existe pas]
 #mixed infos ((string) nom)

#private
Retourne le type d'une connexion [false si la connexion n'existe pas ou s'il y a une erreur]
 #mixed gettype ((string) nom)

Retourne le nom d'une connexion avec sa ressource socket. [false si la connexion n'existe pas]
 #mixed getnamebysocket ((ressource) socket)

*/
 
class socket {
	private $sockets = Array();
	private $newclient = Array();
	public $errors = Array();

	public function listen($name, $ip, $port) {
		$name = strtolower($name);
		if ($this->exists($name)) {
			$this->errors[] = 'socket name '.$name.' already exists (line: '.__LINE__.')';
			return false;
		}
		if (!($a = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
			$this->errors[] = socket_strerror(socket_last_error()).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_set_option($a, SOL_SOCKET, SO_REUSEADDR, 1)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_bind($a, $ip, $port)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_listen($a)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_set_nonblock($a)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		$this->sockets[$name]['sock'] = $a;
		$this->sockets[$name]['read'] = '';
		$this->sockets[$name]['ip'] = $ip;
		$this->sockets[$name]['port'] = $port;
		$this->sockets[$name]['type'] = 'server';
		return true;
	}

	public function connect($name, $ip, $port, $localip = '0.0.0.0') {
		$name = strtolower($name);
		if ($this->exists($name)) {
			$this->errors[] = 'socket name '.$name.' already exists (line: '.__LINE__.')';
			return false;
		}
		if (!($r = @gethostbyname($localip))) {
			$this->errors[] = 'Unable to resolve '.$localip.' (line: '.__LINE__.')';
			return false;
		}
		else $localip = $r;
		if (!($a = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
			$this->errors[] = socket_strerror(socket_last_error()).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_bind($a, $localip)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_connect($a, $ip, $port)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		if (!@socket_set_nonblock($a)) {
			$this->errors[] = socket_strerror(socket_last_error($a)).' (line: '.__LINE__.')';
			return false;
		}
		$this->sockets[$name]['sock'] = $a;
		$this->sockets[$name]['read'] = '';
		$this->sockets[$name]['ip'] = $ip;
		$this->sockets[$name]['port'] = $port;
		$this->sockets[$name]['type'] = 'client';
		return true;
	}

	public function read($name, $length = 1024) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		$a = Array();
		foreach ($this->sockets as $b => $c) {
			if (isset($c['sock'])) $a[] = $c['sock'];
			else unset($this->sockets[$b]);
		}
		if (((bool) $a) && (socket_select($a, $write = NULL, $except = NULL, 0) !== false)) {
			foreach ($a as $b) {
				if ($this->gettype($this->getnamebysocket($b)) == 'server') {
					$i = null;
					$j = null;
					if ($z = @socket_accept($b)) {
						$x = (function_exists('mt_rand') ? 'mt_rand' : 'rand');
						for ($y = chr($x(97,122)).chr($x(97,122)).chr($x(97,122)).chr($x(97,122)); $this->exists($y); );
						socket_getpeername($z, $i, $j);
						$this->sockets[$y]['server'] = $this->getnamebysocket($b);
						$this->sockets[$y]['sock'] = $z;
						$this->sockets[$y]['read'] = '';
						$this->sockets[$y]['ip'] = $i;
						$this->sockets[$y]['port'] = $j;
						$this->sockets[$y]['type'] = 'serverclient';
						$this->newclient[$y] = $this->getnamebysocket($b);
					}
				}
				else {
					$c = @socket_read($b, $length, PHP_BINARY_READ);
					if ((!strlen($c)) || ($c === false)) {
						if ($this->sockets[$name]['read'] === false) {
							if (($d = $this->getnamebysocket($b)) !== false) $this->close($d);
							else @socket_close($b);
							return false;
						}
						$c = $this->sockets[$name]['read'];
						$this->sockets[$name]['read'] = false;
						return $c;
					}
					else {
						if ((($d = $this->getnamebysocket($b)) !== false)) {
							$this->sockets[$d]['read'] .= $c;
						}
					}
				}
			}
		}
		if ($a =& $this->sockets[$name]['read']) {
			if (preg_match("/^([^\n]*)[\n](.*)/s", $a, $r)) {
				$a = $r[2];
				return str_replace(Array("\r", "\n"), '', $r[1]);
			}
		}
		return '';
	}

	public function newclient($name) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		if ($this->gettype($name) != 'server') {
			$this->errors[] = 'listenqueue: '.$name.' is not a server socket (line: '.__LINE__.')';
			return false;
		}
		if ((bool) $this->newclient) {
			foreach ($this->newclient as $a => $b) {
				if ($b == $name) {
					unset($this->newclient[$a]);
					return $a;
				}
			}
		}
		return false;
	}

	public function close($name) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		if (isset($this->newclient[$name])) unset($this->newclient[$name]);
		if (isset($this->sockets[$name]['sock'])) @socket_close($this->sockets[$name]['sock']);
		unset($this->sockets[$name]);
		return true;
	}

	public function write($name, $data, $lf = true) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' data : '.(ereg('PASS',$data) === 1 ? 'PASS ******' : $data).' (line: '.__LINE__.')';
			return false;
		}
		if ($lf) $data .= "\n";
		if ((socket_write($this->sockets[$name]['sock'], $data, strlen($data))) === false) return false;
		return true;
	}

	public function rename($name, $newname) {
		$name = strtolower($name);
		$newname = strtolower($newname);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		if ($this->exists($newname)) {
			$this->errors[] = 'Socket name '.$newname.' already exists (line: '.__LINE__.')';
			return false;
		}
		$this->sockets[$newname] = $this->sockets[$name];
		unset($this->sockets[$name]);
		return true;
	}

	public function exists($name) {
		$name = strtolower($name);
		if (isset($this->sockets[$name])) return true;
		return false;
	}

	private function getnamebysocket($sock) {
		foreach ($this->sockets as $a => $b) {
			if ($b['sock'] == $sock) return $a;
		}
		return false;
	}

	private function gettype($name) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		if (isset($this->sockets[$name]['type'])) return $this->sockets[$name]['type'];
		$this->errors[] = 'Unknow option \'type\' for socket '.$name.' (line: '.__LINE__.')';
		return false;
	}

	public function infos($name) {
		$name = strtolower($name);
		if (!$this->exists($name)) {
			$this->errors[] = 'Unknow socket name '.$name.' (line: '.__LINE__.')';
			return false;
		}
		$a = Array('ip' => NULL, 'port' => NULL, 'type' => NULL);
		$b = $this->sockets[$name];
		if (isset($b['ip'])) $a['ip'] = $b['ip'];
		if (isset($b['port'])) $a['port'] = $b['port'];
		if (isset($b['type'])) $a['type'] = $b['type'];
		if (isset($b['server'])) $a['server'] = $b['server'];
		return $a;
	}

	public final function __construct() {
		
		if (!extension_loaded('sockets')) {
			if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
				@dl('php_sockets.dll') or die('You must have installed socket extension.');
			}
			else {
				@dl('sockets.so') or die('You must have installed socket extension.');
			}
		}
		
	}
	
}
?>

 Conclusion

N'hésitez pas pour les commentaires intéressant et évolutif. Merci
Merci a winwarrior  pour la base même de la source


 Historique

16 février 2008 23:09:06 :
Remerciement

 Sources de la même categorie

Source avec Zip GÉNÉRATION AUTOMATIQUE DE FICHIER .CLASS.PHP EN FONCTION D'U... par ig3
CLASSE D'OBJET DE CRYPTAGE ET DÉCRYPTAGE DE CHAINES DE CARAC... par 8Tnerolf8
Source avec Zip MY.DEVIANTART API par inwebo
CLASSE DE GESTION DE "VARIABLES GLOBALES D'ENVIRONNEMENT" par pifou25
Source avec Zip COLLECTION.CLASS.MIN.PHP par thunderhunter

 Sources en rapport avec celle ci

REDIMENSIONNEMENT D'IMAGE PHP par JStevens
Source avec Zip MY.DEVIANTART API par inwebo
Source avec Zip CLASS SIMPLE CBASEDONNEE par smag42
Source avec Zip CLIENT / SERVEUR : LES SOCKETS par Morphinof
CLASS MAILEUR par coucou747

Commentaires et avis

Commentaire de winwarrior le 16/02/2008 22:11:23

C'est toi l'auteur de cette source? =)

Commentaire de xstyled le 16/02/2008 23:10:29

zappé :)

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Les sockets php [ par PtitKev ] Bonjour&nbsp;&#224; toutes et a tous.Voila je test un bot socket en php. Je me suis rendu compte que les variables &#233;taient propre a une page donc sockets/php [ par agoumi ] bonjour a tous! bon j'ai réaliser une socket serveur en php sous linux,mais lors de l'execution j'ai l'erreur suivant: Fatal error: Call to undefined sockets [ par agoumi ] bonjour,je suis debutant, je nai jamais programmer les socketet jaimerai avoir le code source ainsi que lescommentaires d'une socket client en php, Mo socket/php [ par agoumi ] bonjour a tous! bon j'ai réalisé une socket client php qui envoi un "BEGIN"  et  une socket  serveur  java qui  reçoi  le message et  repond  par  "EN Une CLASS DIV ? [ par Amistrad ] Bonjour, je suis completement débutant en php et poo et avec les methodes que je peux trouver en apprenant je constate que tout le monde travail avec problème à l'upload [ par David_monchy ] Bonjour à tous,Lorsque je souhaite uploader une image, j'ai ceci:Warning: mkdir(): open_basedir restriction in effect. File(/components/com_nbchat/upl sockets [ par agoumi ] bonjour a tous! j'ai réalisé une socket client php dont le code ci-dessous:&lt;?php $fp = fsockopen("localhost",3333, $errno, $errstr, 60); if (!$fp) Message à caractère informatif... [ par J_G ] Bonjour,Je viens de me rendre compte que la doc de PHP (fr.php.net) venait de prendre un serieux coup de boost !!!Vous trouverez maximum de nouvelles socket [ par salim81 ] bonjour a tous! j'ai un script php d'une socket client:  &lt;?php $fp = fsockopen("localhost",9991, $errno, $errstr, 60); if (!$fp) {    echo "$errstr Pb Include() et mes fonctions (O_O) [ par Overcro ] Bonjour, j'ai un problème bizard avec les includes, en local mes tests fonctionnent bienmais dès que j'upload sur mon hébergeur, ça marche aussi, mais


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,640 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales