cURL / Mailing Lists / curl-users / Single Mail

curl-users

reding form data from url to file, modifying, posting back and 'click' submit

From: Jan Paulini <jp_at_eirewire.net>
Date: Fri, 23 Mar 2012 11:00:29 +0000

hello,

here in short what i intend to do. i like to read a form that had
already been filled in. run the content trough a program called
formfind.pl and store the values in a text file. so far so good, i get
all values and here is the line i use:

curl --user user:password
"http://192.168.1.10/admin/config.php?type=setup&display=extensions&extdisplay=198"
| ./formfind.pl > 198.txt

the file 198.txt is below at the end of my post.

now i can modify the file 198.txt and i then hope to use the modified
file to fill the form again and submit. what i tried was this line:

curl --user user:password -d @198.txt http://192.168.1.10/admin/config.php

the above URL is from the previous output

--- FORM report. Uses POST to URL "/admin/config.php"

i get the source code of the website back but my change has not been
made. i assume the format of output from formfind.pl is not suitable for
above line. can someone advise as to how it has to look instead ?

as mentioned above here the output from curl --user user:password
"http://192.168.1.10/admin/config.php?type=setup&display=extensions&extdisplay=198"
| ./formfind.pl

--- FORM report. Uses POST to URL "/admin/config.php"
Input: NAME="display" VALUE="extensions" (HIDDEN)
Input: NAME="type" VALUE="setup" (HIDDEN)
Input: NAME="action" VALUE="edit" (HIDDEN)
Input: NAME="extdisplay" VALUE="198" (HIDDEN)
Input: NAME="action" VALUE="edit" (HIDDEN)
Input: NAME="extdisplay" VALUE="198" (HIDDEN)
Input: NAME="extension" VALUE="198" (HIDDEN)
Input: NAME="name" VALUE="Test CURL 198" (TEXT)
Input: NAME="cid_masquerade" (TEXT)
Input: NAME="sipname" (TEXT)
Input: NAME="outboundcid" (TEXT)
Select: NAME="ringtimer"
  Option VALUE="0" (SELECTED)
  Option VALUE="10"
  Option VALUE="20"
  Option VALUE="30"
[end of select]
Select: NAME="callwaiting"
  Option VALUE="enabled"
  Option VALUE="disabled" (SELECTED)
[end of select]
Select: NAME="call_screen"
  Option VALUE="0" (SELECTED)
  Option VALUE="nomemory"
  Option VALUE="memory"
[end of select]
Input: NAME="emergency_cid" (TEXT)
Input: NAME="tech" VALUE="sip" (HIDDEN)
Input: NAME="hardware" (HIDDEN)
Input: NAME="newdid_name" (TEXT)
Input: NAME="newdid" (TEXT)
Input: NAME="newdidcid" (TEXT)
Input: NAME="devinfo_secret" VALUE="xxxx" (TEXT)
Input: NAME="devinfo_dtmfmode" VALUE="rfc2833" (TEXT)
Input: NAME="devinfo_canreinvite" VALUE="no" (TEXT)
Input: NAME="devinfo_context" VALUE="from-internal" (TEXT)
Input: NAME="devinfo_host" VALUE="dynamic" (TEXT)
Input: NAME="devinfo_type" VALUE="friend" (TEXT)
Input: NAME="devinfo_nat" VALUE="yes" (TEXT)
Input: NAME="devinfo_port" VALUE="5060" (TEXT)
Input: NAME="devinfo_qualify" VALUE="yes" (TEXT)
Input: NAME="devinfo_callgroup" (TEXT)
Input: NAME="devinfo_pickupgroup" (TEXT)
Input: NAME="devinfo_disallow" (TEXT)
Input: NAME="devinfo_allow" (TEXT)
Input: NAME="devinfo_dial" VALUE="SIP/198" (TEXT)
Input: NAME="devinfo_accountcode" VALUE="50822" (TEXT)
Input: NAME="devinfo_mailbox" VALUE="198_at_device" (TEXT)
Input: NAME="devinfo_deny" VALUE="0.0.0.0/0.0.0.0" (TEXT)
Input: NAME="devinfo_permit" VALUE="0.0.0.0/0.0.0.0" (TEXT)
Select: NAME="record_in"
  Option VALUE="Adhoc" (SELECTED)
  Option VALUE="Always"
  Option VALUE="Never"
[end of select]
Select: NAME="record_out"
  Option VALUE="Adhoc" (SELECTED)
  Option VALUE="Always"
  Option VALUE="Never"
[end of select]
Select: NAME="vm"
  Option VALUE="enabled"
  Option VALUE="disabled" (SELECTED)
[end of select]
Input: NAME="vmpwd" (TEXT)
Input: NAME="email" (TEXT)
Input: NAME="pager" (TEXT)
Input: NAME="attach" VALUE="attach=yes" (RADIO)
Input: NAME="attach" VALUE="attach=no" (RADIO)
Input: NAME="saycid" VALUE="saycid=yes" (RADIO)
Input: NAME="saycid" VALUE="saycid=no" (RADIO)
Input: NAME="envelope" VALUE="envelope=yes" (RADIO)
Input: NAME="envelope" VALUE="envelope=no" (RADIO)
Input: NAME="delete" VALUE="delete=yes" (RADIO)
Input: NAME="delete" VALUE="delete=no" (RADIO)
Input: NAME="options" (TEXT)
Input: NAME="vmcontext" VALUE="default" (TEXT)
Select: NAME="vmx_state"
  Option VALUE="" (SELECTED)
  Option VALUE="checked"
[end of select]
Input: NAME="vmx_unavail_enabled" VALUE="checked" (CHECKBOX)
Input: NAME="vmx_busy_enabled" VALUE="checked" (CHECKBOX)
Input: NAME="vmx_play_instructions" VALUE="checked" (CHECKBOX)
Input: NAME="vmx_option_0_number" (TEXT)
Input: NAME="vmx_option_0_system_default" VALUE="checked" (CHECKBOX)
Input: NAME="vmx_option_1_number" (TEXT)
Input: NAME="vmx_option_2_number" (TEXT)
Input: NAME="Submit" VALUE="Submit" (SUBMIT)
--- end of FORM
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-23