Need script to automatically login and send "post" form.

2 replies
I need a script that will automatically login at some websites and send a "post" form.

The login form looks like:

<form action="http://хххххх/login.php" method="post">
<strong>Login</strong><br>
<input type="text" style="width: 250px;" name="sPageName">
<br>
<strong>Password</strong><br>
<input type="password" style="width: 250px;" name="sPassword"><br><br>
<input type="submit" style="width: 250px;" value="Login" name="login">
</form>
The form that must be sent is like:

<form action="http://ххххххх/savePage.php" method="post">
<input type="submit" style="width: 95%;" value="Save" name="save">
</form>
Can someone tell me how i can write such a script?

P.s. i'm a complete noob in .php etc. Maybe there is already such a script?

Thanks.
#automatically #form #login #post #script #send
  • Profile picture of the author babypar
    You can use Curl in PHP, its fairly simple and there are loads of scripts out there just search for "submit form with curl php"
    Signature

    Double Links SEO Link Building Service. High TF, CF
    Backlink Case Study

    {{ DiscussionBoard.errors[2638622].message }}
  • Profile picture of the author SteveJohnson
    You'll need to use cURL to post the login info, then collect the server response. Then send your data in the second form post.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[2638649].message }}

Trending Topics