Problème script Diviseur
Résolu
godLike
Messages postés
277
Statut
Membre
-
godLike Messages postés 277 Statut Membre -
godLike Messages postés 277 Statut Membre -
Bonjour,
Voilà mon petit soucis, j'essaie de creer un script qui trouve si tous les diviseurs d'un nombre que l'on rentre dans un formulaire.
Voici mon code (que je pensais correct mais qui ne marche pas :/) :
<?php
if(!isset($_REQUEST['env']))
{
$a='';
}
for($i=0;$i<=$a;$i++)
{
if(($a%$i)==0)
$d.=.$i." ";
}
?>
<html>
<body>
<center>
<form method='post' action='index.php'>
<input type='text' name='a' value='Entrez un nombre' onFocus="javascript:this.value=''"/>
<input type='submit' value='Valider'/>
</form>
<input type="text" value="<?php echo $d; ?>"/>
</center>
</body>
</html>
En executant l'index , j'ai ça comme réponse :
Warning: Division by zero in C:\wamp\www\ex4\index.php on line 9
Notice: Undefined variable: d in C:\wamp\www\ex4\index.php on line 10
Merci par avance, Cordialement.
Voilà mon petit soucis, j'essaie de creer un script qui trouve si tous les diviseurs d'un nombre que l'on rentre dans un formulaire.
Voici mon code (que je pensais correct mais qui ne marche pas :/) :
<?php
if(!isset($_REQUEST['env']))
{
$a='';
}
for($i=0;$i<=$a;$i++)
{
if(($a%$i)==0)
$d.=.$i." ";
}
?>
<html>
<body>
<center>
<form method='post' action='index.php'>
<input type='text' name='a' value='Entrez un nombre' onFocus="javascript:this.value=''"/>
<input type='submit' value='Valider'/>
</form>
<input type="text" value="<?php echo $d; ?>"/>
</center>
</body>
</html>
En executant l'index , j'ai ça comme réponse :
Warning: Division by zero in C:\wamp\www\ex4\index.php on line 9
Notice: Undefined variable: d in C:\wamp\www\ex4\index.php on line 10
Merci par avance, Cordialement.
A voir également:
- Problème script Diviseur
- Script vidéo youtube - Guide
- Ghost script - Télécharger - Polices de caractères
- Mas script - Accueil - Windows
- Script cmd - Guide
- Script download - Télécharger - Édition & Programmation