par
josse34 » 24 déc. 2011, 12:35
Merci mais je n'y parviens pas.
L'index indique :
<frame src="top.htm" name="topFrame"
<frame src="home_frameset.htm" name="mainFrame"
<frame src="bottom.htm" name="bottomFrame"
Lorsqu'on regarde le code source du formulaire qui est situé sur mainFrame c'est :
<form action="login" target="mainFrame" method="post">
<td class="tdcol0">Mot de passe:</td>
<td class="tdcol1"><input name="Password" class="input-text" type="password" size="32"></td>
<td class="buttonrow"><input name="ButtonLogin" Value="Connexion" class="input-submit" type="submit" size="9"></td>
Ainsi, la cible du login est mainFrame soit
http://82.240.3.212/home_frameset.htm
Le nom du champs mot de passe est Password
Une fois identifié, je souhaite aller sur
http://82.240.3.212/plant_devices_treefrm.htm
Ainsi, en toute logique soit je vise directement home_frameset.htm et je refuse les transfert dans mon curl, soit je vise index et je spécifie que le post doit se faire dans le mainFrame.
Voici mon code qui renvois vers une erreur 404 :
Code : Tout sélectionner
$post = array('Password' => '1234');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://82.240.3.212/home_frameset.htm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_exec($ch);
curl_close($ch);
$ch2 = curl_init();
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, "http://82.240.3.212/plant_devices_treefrm.htm");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, false);
$output = curl_exec($ch2);
curl_close($ch2);
print_r($output);
Le soucis etant que cela ne concerne que mon serveur, si je vise Google avec ce code, cela affiche la page, contriarement à mon serveur qui renvoi vers une erreur 404 :
Code : Tout sélectionner
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://82.240.3.212/home_frameset.htm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
Ce code doit m'en empecher dans mainFrame:
Code : Tout sélectionner
<script type="text/javascript">
<!--
function checkFrameset()
{
if(self.parent.name != "mainFrame")
{
top.location = "index.html";
}
}
-->
</script>
</head>
<body>
<script type="text/javascript">
<!--
checkFrameset();
-->
</script>
Merci mais je n'y parviens pas.
L'index indique :
[quote]<frame src="top.htm" name="topFrame"
<frame src="home_frameset.htm" name="mainFrame"
<frame src="bottom.htm" name="bottomFrame"[/quote]
Lorsqu'on regarde le code source du formulaire qui est situé sur mainFrame c'est :
[quote]<form action="login" target="mainFrame" method="post">
<td class="tdcol0">Mot de passe:</td>
<td class="tdcol1"><input name="Password" class="input-text" type="password" size="32"></td>
<td class="buttonrow"><input name="ButtonLogin" Value="Connexion" class="input-submit" type="submit" size="9"></td>[/quote]
Ainsi, la cible du login est mainFrame soit http://82.240.3.212/home_frameset.htm
Le nom du champs mot de passe est Password
Une fois identifié, je souhaite aller sur http://82.240.3.212/plant_devices_treefrm.htm
Ainsi, en toute logique soit je vise directement home_frameset.htm et je refuse les transfert dans mon curl, soit je vise index et je spécifie que le post doit se faire dans le mainFrame.
Voici mon code qui renvois vers une erreur 404 :
[code]
$post = array('Password' => '1234');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://82.240.3.212/home_frameset.htm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_exec($ch);
curl_close($ch);
$ch2 = curl_init();
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, "http://82.240.3.212/plant_devices_treefrm.htm");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, false);
$output = curl_exec($ch2);
curl_close($ch2);
print_r($output);
[/code]
Le soucis etant que cela ne concerne que mon serveur, si je vise Google avec ce code, cela affiche la page, contriarement à mon serveur qui renvoi vers une erreur 404 :
[code]
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://82.240.3.212/home_frameset.htm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
[/code]
Ce code doit m'en empecher dans mainFrame:
[code]
<script type="text/javascript">
<!--
function checkFrameset()
{
if(self.parent.name != "mainFrame")
{
top.location = "index.html";
}
}
-->
</script>
</head>
<body>
<script type="text/javascript">
<!--
checkFrameset();
-->
</script>
[/code]