<?php

// Dynamic Select Save
// (c) 2009 Denis Sureau - Xul.fr

		session_start();
	
	$_SESSION['database']="local";
	
	if($_SESSION['database']=="local")
	  {
	     $db_host    = "localhost";
	     $db_user   = "root";
	     $db_pass   = "";
     	     $db_name   = "boutique";

	 }
	
	if($_SESSION['database']=="public")
	  {
  	     $db_host    = "sql2";
   	     $db_user   = "analogde";
 	     $db_pass   = "rainbow";
    	     //$db_type   = "mysql";
	     $db_name   = "analogde";
	 }

	 $connexion = mysql_connect($db_host,$db_user,$db_pass); 
	 mysql_select_db($db_name, $connexion);



	//$f = fopen("abc.txt, "w");
	//$counter = 1;
	//$contenu = $_POST["tab".strval($counter) ]
	//fputs($f, $contenu ."<br>");
	//fclose($f);


	//echo "++++++" $_POST['nom'];
	
	//echo '<body onLoad="alert(\'Membre non reconnu...\')">'; 

	//header("Location: go.php");
 			
 		/*if( isset($_SESSION['select_option']) && !empty($_SESSION['select_option']) ) 	
 		  {	//$nom_fichier = $_POST['nom'];
 		  	$f = fopen("lili.txt, "w");
			fputs($f, "essai pour voir" ."<br>");
			fclose($f);
 		  	
 		  }*/	
 			
 			
 		/*if( !isset($_SESSION['select_option']) && empty($_SESSION['select_option']) ) 	
 		  {	
 		   
			if(strpos($_POST, "<")) die("Hacking!");*/

			$counter = 0;
		
			//$f = fopen($nom_fichier, "w");
			$f = fopen("abc.txt, "w");


			$i = 0;
		
	
			while($url = $_POST["tab".strval($counter) ])
		             {
			     
			         $url =  addslashes($url);
				 if($i == 0)
				   { $chaine = $url ;
				   }	

				 if($i != 0)
				   { $chaine = $chaine ."," .$url  ;
				   }	
			
    				//fputs($f, $url."<br>");
    				$counter ++;
    				//if(counter > 96) break;   // something wrong
    			
    				$i = $i +1;
			    }

		/*$_SESSION['select_option']= $chaine;
			
		}	*/
			
			
			
			fclose($f);

		
			// inhibe pour le developpement 
		
			// $element = "lave_linge" ;
			// $requete = "UPDATE categorie SET descriptif = '$chaine'  WHERE table_article = '$element' ";
 	 		// $result = mysql_query($requete);

			// fclose($f);
			 
			 
			 /*$blase = $_POST['nom'];
			 $n = $_POST['val'];
			 $envoi = $_POST['a'];
			 
			 echo "+++++++";
			 echo "<br>";
			 echo "+++++++";
			 echo "<br>";
			 echo "+++++++";
			 echo "<br>";
			 echo "+++++++";
			 echo "<br>";
			 
			 
			 
			 
			 print_r($envoi);*/
			 
			 //$f = fopen($nom_fichier, "w");
			 //fputs($f, "essai pour voir" ."<br>");
			 //fclose($f);*/
			 
			/*$nom = $_POST['nom'];
 		  	$val = $_POST['val'];
 		  	
 		  	$f = fopen($nom, "w");
			fputs($f, $val ."<br>");
			fclose($f);*/
			 
			 

		

?>
