PHP, fonction unlink();
bouffchidor95
Messages postés
30
Date d'inscription
Statut
Membre
Dernière intervention
-
bouffchidor95 Messages postés 30 Date d'inscription Statut Membre Dernière intervention -
bouffchidor95 Messages postés 30 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Alors j'ai un problème sur ma fonction unlink() comme vous vous en doutez ...
Voila mes lignes de code :
<table>
<tr>
<form method="post" action="test.php">
<td>Suppression article :</td>
<td><input type="text" name="SupprArticle" size="30"></td>
</tr>
</table>
<center><input type="submit" value="OK"></center><br>
<?php
$filename='';
if(isset($_POST['SupprArticle']));
{
$filename=$_POST['SupprArticle'];
$filename=$filename.'.php'; /* j'ai ajouté cette ligne pour testé */
echo($filename); /* */
unlink($file_name); /* j'ai mis : unlink("nomfichier.php"); . Et ça a marché */
}
Seulement lorsque je saisi nomdufichier, ça ne marche pas et ça me dit :
nomdufichier.php
Notice: Undefined variable: file_name in C:\wamp\www\Site angelie\test.php on line 63
Warning: unlink() [function.unlink]: No error in C:\wamp\www\Site angelie\test.php on line 63
Si quelqu'un a une idée ?
<config>Windows 7 / Firefox 12.0</config>
Alors j'ai un problème sur ma fonction unlink() comme vous vous en doutez ...
Voila mes lignes de code :
<table>
<tr>
<form method="post" action="test.php">
<td>Suppression article :</td>
<td><input type="text" name="SupprArticle" size="30"></td>
</tr>
</table>
<center><input type="submit" value="OK"></center><br>
<?php
$filename='';
if(isset($_POST['SupprArticle']));
{
$filename=$_POST['SupprArticle'];
$filename=$filename.'.php'; /* j'ai ajouté cette ligne pour testé */
echo($filename); /* */
unlink($file_name); /* j'ai mis : unlink("nomfichier.php"); . Et ça a marché */
}
Seulement lorsque je saisi nomdufichier, ça ne marche pas et ça me dit :
nomdufichier.php
Notice: Undefined variable: file_name in C:\wamp\www\Site angelie\test.php on line 63
Warning: unlink() [function.unlink]: No error in C:\wamp\www\Site angelie\test.php on line 63
Si quelqu'un a une idée ?
<config>Windows 7 / Firefox 12.0</config>
A voir également:
- PHP, fonction unlink();
- Fonction si et - Guide
- Easy php - Télécharger - Divers Web & Internet
- Fonction miroir - Guide
- Fonction moyenne excel - Guide
- Expert php pinterest - Télécharger - Langages