Syntax error, unexpected end of file

Fermé
Wzeey Messages postés 5 Date d'inscription mercredi 21 mai 2014 Statut Membre Dernière intervention 7 juillet 2014 - Modifié par Wzeey le 16/06/2014 à 14:46
Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 - 16 juin 2014 à 14:54
Bonjour,

J'ai un problème dans mon code, je ne troue pas où est le problème, peut-être pourrez-vous m'aider :/
Le voici :


<?php    
session_start();
include("config.php");
include("function.php");
//include("pc.php");
//import_request_variables("G","recu_");
/* if (!session_is_registered("USER")){
print '<link href="./css/style.css" rel="stylesheet" type="text/css"><center><h2 class="maintitle">Vous n\'êtes pas identifié<br> <br><a href="index.php">connection</a> </h2></center>';exit;
}*/
//connexion à la bd
$cnx=mysql_connect("localhost", "root", "") or die (mysql_error ());
$db=mysql_select_db("suivi") or die(mysql_error());
mysql_query("SET NAMES 'utf8'");



//SQL query
$requete = mysql_query('SELECT * FROM list_pc');

while($result = mysql_fetch_array($requete))
{


//modification

if ((!empty($_POST['valider_modif'])) && ($_POST['valider_modif'] == "Modifier")) {
$ACT_NOM=$_POST['NOM_USER'];
$ACT_IP=$_POST['IP'];
$LAST_INTERV=$_POST['LAST_INTERV'];
$LAST_INTERV=Change_formatDate($LAST_INTERV, 'en');
$ACT_CLEAN=$_POST['ACT_CLEAN'];
$ACT_CACHE=$_POST['ACT_CACHE'];
$ACT_MAJ_SYS=$_POST['ACT_MAJ_SYS'];
$ACT_ANTI_VIR=$_POST['ACT_ANTI_VIR'];
$ACT_FORMAT=$_POST['ACT_FORMAT'];
$ID=$_POST['ID'];
$ACT_AUTRES=$_POST['ACT_AUTRES'];
$update= ("UPDATE list_pc SET ACT_NOM='$NOM_USER', ACT_IP='$IP', LAST_INTERV='$LAST_INTERV', ACT_CLEAN='$ACT_CLEAN', ACT_CACHE='$ACT_CACHE', ACT_MAJ_SYS='$ACT_MAJ_SYS', ACT_ANTI_VIR='$ACT_ANTI_VIR', ACT_FORMAT='$ACT_FORMAT', ACT_AUTRES='$ACT_AUTRES' WHERE ID='$ID'");

$result = mysql_query($update) or die(mysql_error());
echo '<link href="./css/style.css" rel="stylesheet" type="text/css"><center><h2 class="maintitle">Les modifications a été pris en compte...</h2></center>';
echo'<script>setTimeout("location=\'pc.php\'",1500)</script>';
exit;
} else {
$query = "SELECT * FROM 'list_pc'";
$result = mysql_query($query) or die(mysql_error());
$change= mysql_fetch_array($result);
}
$temps = microtime(); // Timestamp actuel avec microsecondes
$temps = explode(' ', $temps); // Segmente le timestamp
$debut = $temps[1] + $temps[0];

//connexion à la bd

//requete
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<link href="./css/style.css" rel="stylesheet" type="text/css">
<!--Calendrier-->
<script type="text/javascript" src="./js/calendrier.js"></script>
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="./css/design.css" />
<title>Console administration
</title>
</head>
<body>
<table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;" >
<tr>
<td id="ds_calclass"></td>
</tr>
</table>
<h2 class="maintitle">
<center>Console administration : Détail PC </center></h2>
<div id="content"> <h5>Vous êtes connecté en tant que <u>
<?php echo $_SESSION["PROFIL"];?></u></h5>
<br>
<?php include"header.php";?>
<form name="form1" action="add.php" method="POST" >
<table width=100%>
<input name="ID" type= "hidden" type="text" value="<?php echo $change['ID']; ?>">
<tr><td>Nom PC :</td><td>
<input type="text" size="50" class="input_text" name="ACT_NOM" "></td>
</tr>
<tr><td>IP: </td><td>
<input type="text" size="50" class="input_text" name="ACT_IP" ></td>
</tr>
<tr> <td>Dernière intervention :</td><td>
<input type="text" class="input_text" name="LAST_INTERV" value="1" onclick="ds_sh(this);"></td>
</tr>
<tr>
<td width="30%" >Nettoyage : </td><td>
<input type="checkbox" name="ACT_CLEAN" value="1" ></td>
</tr>
<tr><td>Cache : </td><td>
<input type="checkbox" name="ACT_CACHE" value="1" ></td>
</tr>
<tr><td>MAJ Système : </td><td>
<input type="checkbox" name="ACT_MAJ_SYS" value="1" ></td>
</tr>
<tr><td>MAJ Anti-Virus : </td><td>
<input type="checkbox" name="ACT_ANTI_VIR" value="1" ></td>
</tr>
<tr> <td>Formatage : </td><td>
<select name="ACT_FORMAT" >
<option value="Prévu" >Prévu
</option>
<option value="Non prévu" >Non prévu
</option>
</select> </td>
</tr>
<tr><td>Notes: </td><td>
<input type="text" size="50" class="input_text" name="ACT_AUTRES"></td>
</tr>
</table>
<br>
<input type="hidden" name="valider_modif" type="radio" value="Modifier" checked>
<input type="submit" name="valider_display" class="input_submit" value="Valider" style="width:80px">
<a href="pc.php" target="_self" >Retour
</center></a>
</form>
</div>
<br>
<br>
<?php
//fermeture de la bd
mysql_close();
$temps = microtime();
$temps = explode(' ', $temps);
$fin = $temps[1] + $temps[0];


echo$update;

// execution de la requete de UPDATE
mysql_query($update);
// afficher message modification OK

echo "La modification a bien été prise en compte";

// redirection vers liste

header ("Refresh: 3;URL=pc.php");
?>


Merci à ceux qui m'aideront :)
Cordialement,
A voir également:

1 réponse

Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 524
16 juin 2014 à 14:54
Salut,

Ta boucle while n'est pas fermée (il te manque l'accolade fermante).

Bonne journée
1