[PHP]Multiple Action Form

- 12:41 PM
advertise here
advertise here
<CODE>
<form name="myWebForm" action="multiple.php" method="post">
<input name="sometext" type="text" />
<input name="pass" type="password" />
<input type="submit" value="SUBMIT" />
</form>

</CODE>


Đặt code bên dưới tên File Là multiple.php
<?phpif(isset($_POST['sometext'],$_POST['pass']))
{
    for(
$i=1;$i<=2;$i++)
    {
        
$ch curl_init("http://url.of/action".$i.".php");
        
curl_setopt($chCURLOPT_POSTtrue); // We'll post data
        
curl_setopt($chCURLOPT_POSTFIELDS"sometext=".$_POST['sometext']."&pass=".$_POST['pass']); // Two post fields added
        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        if(
$execute curl_exec($ch))
        {
            echo 
"Done in action".$i.".php<br />";
        }
        
curl_close($ch);
    }
}
?>
Advertisement advertise here
 

Start typing and press Enter to search