hillz
hillz

Reputation: 547

How to use wget to post a html form?

I have a form like this located at http://www.sms-online.web.id:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<body>

    <form method="post" enctype="multipart-form-data" name="my_form" onsubmit="clearTextBoxCounter()" action="http://www.sms-online.web.id/kirim" >

      <input type=hidden name=teks value=><center><b>KIRIM SMS GRATIS</b></center><br><br>
    Nomer:<br />
      <input type="text" maxlength="20" name="Phonenumbers" value="08888888"/>
      <br />

    <br />
    Isi:<br />
    <textarea rows="5" cols="50" onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=Text >
    Content of my sms
    </textarea>
    <br />

    <input id="saveForm" class="btTxt" type="submit" value="KIRIM" name="TOMBOL" />

    </body>
    </html>

I would like to post to that form and then submit it, how do I use wget to do the job? I've read about wget --post-data xxx but I still don't know what I should type in in the terminal, based on that html file, should I type in like this? (I'm really not sure it'll work) wget --post-data value=08585858 textarea="Content of my sms" http://www.sms-online.web.id

Upvotes: 7

Views: 20820

Answers (1)

nhylated
nhylated

Reputation: 1585

From this SO question:

wget --post-data="value=08585858&textarea=\"Content of sms\"" <url>

Also check this.

Upvotes: 9

Related Questions