auto login with cURL where submit button has no name ?

Discussion in 'PHP' started by Mahfouz, Jun 17, 2010.

  1. #1
    <form action="/dir/Twitter.aspx/InviteTweet" method="post">
    
                        <font face="Verdana" size="0">Usename: </font>
                        <input id="Text1" type="text" name="txtEmail" /><br />
                        <font face="Verdana" size="0">Password: </font>
                        <input id="Text2" type="password" name="txtPassword" /><br />
                        <br />
                        <input id="Submit1" type="submit" value="Sign in" />
    HTML:
    the input <input id="Submit1" type="submit" value="Sign in" /> has no name

    my php code

    $url = "http://www.my site.com/dir/Twitter.aspx/Index"; // This page contains Login form
    
            $postfields='txtEmail=username&txtPassword=password';
            $ch=curl_init($url);
            curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
            curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
            $page=curl_exec($ch);
    
            curl_close($ch);
    PHP:

    is there any way to use input id="Submit1" instead of it's name as there is no name ??
     
    Mahfouz, Jun 17, 2010 IP