All pastes #987277 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-04-16 12:16 UTC
rendered paste body
<?php
if ($_COOKIE['conn'] == 'ok')
{
include('connect.php');
	if(isset($_POST["titre_article"]) && isset($_POST["description_article"]))
		{//récupération des valeurs des champs:
		$num = $_POST["num_article"] ;
		$titre = $_POST["titre_article"] ;
		$description = $_POST["description_article"] ;
		
		//création de la requête SQL:
		$sql2 ='UPDATE '.$_POST["table"].' SET '.$_POST["prefixe"].'description WHERE '.$_POST["prefixe"].'num = \''.$_POST["num_article"].'\';';
		$sql1 ='UPDATE '.$_POST["table"].' SET '.$_POST["prefixe"].'titre WHERE '.$_POST["prefixe"].'num = \''.$_POST["num_article"].'\';';
		
		//exécution des requêtes SQL:
		
		$requete2 = mysql_query($sql2) or die( mysql_error() ) ;
		$requete1 = mysql_query($sql1) or die( mysql_error() ) ;
		
		}
		
	header('location:'.$_POST["pageretour"].'');
	
	mysql_close($conn);
	
}
else
{
header('location:identification.php');
}
?>