bonsoir,
Je travaille sur Dreamweaver CS5, je veux vérifier la syntaxe d'un email. Le problème c'est qu'il m'affiche uniquement la première phrase echo, voici les codes PHP et HTML:
1- PHP: verifform.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php 
 
$email = $_POST['email'];
$point = strpos(email,".");
$arob = strpos(email,"@");
 
if ($point==''){
 echo "Votre email doit comporter un <b> point </b>";
}
 elseif ($arob==''){
  echo "Votre email doit comporter un <b> '@' </b>";
}
else{
 echo" Votre email est: '<a href=\" :"."$email"."\"><b>$email</b></a>";
}
?>
2-HTML: verifform.html
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
</head>
 
<body>
<form id="form1" name="form1" method="post" action="verifform.php">
  <p>Votre eMail : 
    <input type="text" name="email" id="email" />
  </p>
  <p>Envoyer: 
    <input type="submit" name="valid" id="valid" value="Envoyer" />
  </p>
</form>
</body>
</html>
Voici ce qu'on m'affiche lors de l'exécution du code HTML peu importe ce que j'écris dans la case email:
Notice: Use of undefined constant email - assumed 'email' in D:\SITE Messagerie CS5\Apprendre PHP\verifform.php on line 4
Notice: Use of undefined constant email - assumed 'email' in D:\SITE Messagerie CS5\Apprendre PHP\verifform.php on line 5
Votre email doit comporter un point