Bonjour,

Depuis un site Webdev, je veux remplir le formulaire d'un autre site qui se présente sous cette forme :

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
function postlogin()
{
if(document.getElementById('username').value == '')
{
 
document.getElementById('username').focus();
alert('SVP entrez votre nom d\'utilisateur');
 
}
else if(document.getElementById('password').value == '')
{
 
document.getElementById('password').focus();
alert('SVP entrez votre mot de passe');
 
}
else
{
document.getElementById('loginfrm').submit();
}
 
 
}
<FORM method="POST" id="loginfrm">
<input type="hidden" name="login" value="1">
<input type="hidden" name="next" value="d=VYLUHARP"><TR>
<TD>Nom d'utilisateur </TD>
<TD><input type="text" style="width:195px; height:22px; border:solid 1px; border-color:#CCCCCC;" name="username" id="username" onKeyDown="if(event.keyCode==13)document.getElementById('password').focus();"></TD>
</TR>
<TR>
<TD colspan="2" height="4"></TD>
</TR>
<TR>
<TD>Mot de passe </TD>
<TD><input type="password" style="width:195px; height:22px; border:solid 1px; border-color:#CCCCCC;" name="password" id="password" onKeyDown="if(event.keyCode==13)postlogin();"></TD>
</TR>
<TR>
<TD colspan="2" align="right" style="padding-top:5px;">
<div style="position:relative; width:114px; height:28px; cursor:pointer;" onclick="javascript:postlogin();" onmouseover="submitbtn.src=document.getElementById('submitbutton1').src; document.getElementById('submitbutton1').src=submitbtno.src;" onmouseout="document.getElementById('submitbutton1').src=submitbtn.src;" id="submitbutn1"><div style="position:absolute; left:0px; top:0px;"><IMG SRC="http://site.com/gui2/acc_but.gif
" WIDTH="114" HEIGHT="28" BORDER="0" ALT="" id="submitbutton1"></div><div style="position:absolute; left:0px; top:5px; width:114px; text-align:center; font-family:arial; font-size:px; color:#FFFFFF; font-weight:bold; text-decoration:none;">Connexion</div></div>
</TD>
</TR>
</FORM>
Donc j'ai tenté avec :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
HTTPRequête("http://www.site.com/?c=login&next=d%3DVYLUHARP&setlang=fr","Mozilla/5.0")
HTTPCréeFormulaire("loginfrm")
HTTPAjouteParamètre("loginfrm","username","pseudo")
HTTPAjouteParamètre("loginfrm","password","monpass")
HTTPAjouteParamètre("loginfrm","next","d=VYLUHARP")
HTTPAjouteParamètre("loginfrm","login","1")
HTTPAjouteParamètre("loginfrm","action","javascript:postlogin();")
bResultat est un booléen = HTTPEnvoieFormulaire("loginfrm","http://www.site.com/?c=login&next=d%3DVYLUHARP&setlang=fr",httpPost,"Mozilla/5.0")
sPageAcces est une chaîne
sPageAcces = HTTPDonneRésultat(httpEntête)
Malheureusement, ça ne marche pas, je reviens toujours sur la page de login. J'ai regardé l'exemple de pilotage d'IE fournit avec Windev mais je ne sais comment l'adapter en Webdev.

Quelqu'un peut m'aider ? Merci