Bonjour,

J'essaie de trouver un module d'invitation msn pour mon site.

J'ai trouvé une classe Msn Messenger 9.

Il me reprend bien tous les contacts msn mais quand il faut envoyer l'invitation il y a un problème.

Impossible de sélectionner les adresses pour ensuite envoyer.

J'ai donc ajouté une partie de code. Le problème est qu'il n'envoie l'invitation qu'à la dernière personne sélectionnée et pas à toute la sélection.

Pouvez-vous m'aider ?

invitemsn.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
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
 
<html>
<head>
 
</head>
<body>
<form action="invitemsn.php" method="POST">
	<table cellspacing="5" background="images/fond_msn.jpg" width="298" height="231" align="center">
		<tr>
        	<td height="50">
            </td>
        </tr>
		<tr>
        	<td align="left" height="15" style="color:#3B3E41;font-size:10px;padding-left:55px">
            Adr. de messagerie :
            </td>
        </tr>
		<tr>
        	<td align="left" height="15" style="color:#3B3E41;font-size:10px;padding-left:55px">
            <input type="text" maxlength="255" value="" name="username">
            </td>
        </tr>
		<tr>
        	<td align="left" height="15" style="color:#3B3E41;font-size:10px;padding-left:55px">
       		Mot de passe : 
        	</td>
        </tr>
		<tr>
        	<td align="left" height="15" style="color:#3B3E41;font-size:10px;padding-left:55px">
        	<input type="password" maxlength="255" value="" name="password">
        	</td>
        </tr>
		<tr>
        	<td align="center">
            <input type="submit" value="Connexion">
            </td>
       	</tr>	
    </table>
</form>
<?php
 
if((isset($_POST['username'])) && (isset($_POST['password']))) {
include('msn_contact_grab.class.php');
 
$msn2 = new msn;
 
$returned_emails = $msn2->qGrab($_POST['username'], $_POST['password']);
 
 
 
echo "<form action='sendmsn.php' method='post'>Cochez les amis à inviter et appuyer ensuite sur ENVOYER.<br /><table border='1'>";
        foreach($returned_emails as $row){
 
          echo "<tr><td><input type='checkbox' name='emails' value=".$row['0']." UNCHECKED /></td><td><b>".$row['0']."</b>&nbsp;".$row['1']."</td></tr>";
        };
        echo "</table><input type='submit' value='Envoyer !' />";
 
}
 
 
?>
</body>
</html>
Et sendmsn.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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
<?php
if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( 'init.php' );
}
 
include( 'sessioninc.php' );
 
$sname = trim( $_SESSION['UserName'] );
$femail = trim( $_POST['emails'] );
 
$subject = "Invitation personnelle";
 
$body = get_lang('invite_a_friend', MAIL_FORMAT);
 
$body = str_replace( '#FromName#',  $sname , $body );
 
$From    = $config['admin_email'];
$To = $femail;
 
$success = mailSender($From, $To, $femail, $subject, $body);
 
if( $success ) {
	$t->assign('msg', get_lang('taf_errormsgs',0) );
} else {
	$t->assign('msg', $lang('taf_errormsgs',3) );
}
 
$t->assign('rendered_page', $t->fetch('sendmsn.tpl') );
$t->display ( 'index.tpl' );
?>