<?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);


		if(strpos($_POST, "<")) die("Hacking!");

		$counter = 0;
		$f = fopen("kiki.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;
		}

		
			 $element = "lave_linge" ;
			 $requete = "UPDATE categorie SET descriptif = '$chaine'  WHERE table_article = '$element' ";
 	 		 $result = mysql_query($requete);

			 fclose($f);

		

?>
