if ($_POST['editer'])
{
if ($_POST['nompage'])
{
$_SESSION['nompage'] = $_POST['nompage'];
$fpedit=fopen($_POST['nompage'].".php","r");
$contenu = fread($fpedit, filesize($_POST['nompage'].".php"));
$_SESSION['choix'] = 1;
//======================EDITION DE LA PAGE==============================
?>
//======================FIN D'EDITION DE LA PAGE==============================
}
else
{
header('Location: http://thunderstrikecompany.dyndns.org/index.php?page=access/diff&down=1');
$_SESSION['choix'] = 0;
}
}
if ($_POST['modifier'])
{
$fpedit=fopen($_POST['nompage2'].".php","w");
fwrite($fpedit,$_POST['contenu']."\r\n");
$date = date('y/m/d à H:i:s');
$destinataire = "thunderstrikecompany@yahoo.fr";
$sujet = "Modification effectuée";
$from = "From:serveur\n";
$from .= "MIME-version: 1.0\n";
$from .= "Content-type: text/html; charset= UTF-8\n";
$from .='Content-Transfer-Encoding: 8bit';
$message =
'page : '.$_POST['nompage2'].'
Adresse IP : '.$_SERVER["REMOTE_ADDR"].'
User agent : '.$_SERVER["HTTP_USER_AGENT"].'
Date : le '.$date.'
---
Ce message a été envoyé par le serveur de la Thunder Strike Company.
Veuillez ne pas répondre à ce message, il a été envoyé par un mailer, et l\'adresse n\'existe pas.
http://thunderstrikecompany.dyndns.org ';
if(mail($destinataire,$sujet,$message,$from))
{
$_SESSION['choix'] = 0;
header('location: http://thunderstrikecompany.dyndns.org/index.php?page=access/diff&up=1');
}
else
{
echo "échoué :
".$destinataire."
".$sujet."
".$message."
";
echo '
Retour ';
$_SESSION['choix'] = 0;
}
}
if ($_POST['annuler'])
{
$_SESSION['choix'] = 0;
header('Location: http://thunderstrikecompany.dyndns.org/index.php?page=access/diff&down=2');
}
if ($_SESSION['choix'] != 1)
{
?>
Maintenance
if ($_GET['up'])
{
echo 'La modification a bien été envoyée. Cliquez ici pour revenir à l\'accueil .
';
}
elseif ($_GET['down'] == 1)
{
echo 'Vous avez oublié de remplir au moins un champ obligatoire, recommencez.
';
}
elseif ($_GET['down'] == 2)
{
echo 'Les modifications ont été annulées.
';
}
?>
Nom :
}
?>