Précédent   Forum des professionnels en informatique > PHP > Langage > Syntaxe
Syntaxe Forum d'entraide sur la syntaxe de PHP et la POO. Avant de poster -> FAQ syntaxe, Cours d'initiation et cours de POO
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 31/05/2011, 17h56   #1
Invité régulier
 
jm schweitzer
Inscription : juin 2010
Messages : 39
Détails du profil
Informations personnelles :
Nom : jm schweitzer

Informations forums :
Inscription : juin 2010
Messages : 39
Points : 6
Points : 6
Par défaut problème affichage lien a href

Bonjour,
j'ai un problème avec ce lien...
Code :
$message .= '<a href="http://site/facturier/mailing.php?adresse='.$mail1 .'"> Envoyer le mail</a>'."\n"."\n";
Dans les mails il s'affiche comme ça:
<a href="http://site/facturier/mailing.php?adresse=adresse@free.fr"> Envoyer le mail</a>

merci pour votre aide
jmsch est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 17h58   #2
Modérateur
 
Inscription : septembre 2010
Messages : 7 103
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 103
Points : 8 466
Points : 8 466
tu voudrais qu'il s'affiche comment ?
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 18h06   #3
Invité régulier
 
jm schweitzer
Inscription : juin 2010
Messages : 39
Détails du profil
Informations personnelles :
Nom : jm schweitzer

Informations forums :
Inscription : juin 2010
Messages : 39
Points : 6
Points : 6
l'affichage serait bien plus sympa sans tout le code, juste :
Envoyer le mail
jmsch est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 18h12   #4
Modérateur
 
Inscription : septembre 2010
Messages : 7 103
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 103
Points : 8 466
Points : 8 466
ah oki, montre le reste du code doit y avoir un htmlentities ou autre dans le coin
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 18h30   #5
Invité régulier
 
jm schweitzer
Inscription : juin 2010
Messages : 39
Détails du profil
Informations personnelles :
Nom : jm schweitzer

Informations forums :
Inscription : juin 2010
Messages : 39
Points : 6
Points : 6
le code
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if(isset($_GET['action'])){
	echo'<p align="center"><br/>Pour envoyer le mail à un ami, remplissez le formulaire ci-dessous.</p>';
 
	echo'	<form  action = "contact_mailing.php" method="post">	
			<table align="center" width="50%">
				<tr align="center">
					<td>Destinataire : votre ami</td>
				</tr>
 
				<tr align="center">
					<td>Email : <input type="text" name="mail1" value="" /></td>
				</tr>
 
				<tr align="center">
					<td> Nom : <input type="text" name="nom" value="" /></td>
				</tr>
 
				<tr align="center">
					<td> <input type="submit" value="Envoyer" /></td>
				</tr>
			</table>
			</form>
		';
	exit;
}
 
 
$ok=false;	
//début du traitement du formulaire
	if (!empty ($_POST['mail1'])){	
		$nom = trim($_POST['nom']);  
		$mail1 = trim($_POST['mail1']); 
 
 
 
	//controle validé saisie	
	 if(
		($nom!='') && 
		($mail1!='' && preg_match($code_syntaxe_mail,$mail1))
	)	
	{$ok=true;}	
 
 
	//mise en forme de toutes les saisies, si ok=true=vrais
	if($ok == true)	{	
 
 
	$mail1 = trim($_POST['mail1']);
	$message .= '<a href="http://site/facturier/mailing.php?adresse='.$mail1 .'"> Envoyer le mail à mon ami</a>'."\n"."\n";
	$message .= 'Le ' .date('d-m-Y') .' à ' .date('H:i:s') ."\n";
	$message .= $nom."\n";
	$message .= $mail1."\n";
 
 
	$to      = ADRESS_EXPEDITEUR_MAIL;
	$subject = 'Contact';
 
	$headers = 'From: "'.$nom.'"  <'.$mail1.'>'."\r\n";
	$headers .= 'Reply-To: <'.$mail1.'>'."\r\n";
	$headers .='X-Mailer: PHP/' . phpversion();
	mail($to, $subject, $message, $headers);
 
	if(mail($to, $subject, $message, $headers)) { 
		echo 'Le mail a été envoyé';
		header('Location: index.php');
	} 
     else { 
		echo 'Le mail a pas été envoyé'; exit;
    } 
}
jmsch est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 18h35   #6
Modérateur
 
Inscription : septembre 2010
Messages : 7 103
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 103
Points : 8 466
Points : 8 466
c'est normal ton mail est envoyé en mode texte par défaut, si tu veux envoyer une page HTML tout est dans la doc :

http://fr.php.net/manual/fr/function.mail.php
__________________
http://blog.stealth35.com/
stealth35 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/05/2011, 21h03   #7
Invité régulier
 
jm schweitzer
Inscription : juin 2010
Messages : 39
Détails du profil
Informations personnelles :
Nom : jm schweitzer

Informations forums :
Inscription : juin 2010
Messages : 39
Points : 6
Points : 6
Merci à toi....
Trop nul, le pire c'est que je le savais.
jmsch est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h48.


 
 
 
 
Partenaires

Hébergement Web