Forum Moderators: bakedjake

Message Too Old, No Replies

wget post-data

         

Hevymetal

10:09 am on Sep 8, 2004 (gmt 0)

10+ Year Member



Hi

I want to get page source with wget and i want to give some variable value with POST method.

with this url, the POST variable name is "example_name" and i want to apply value "testing"to it.

So in php source it would look like:

$_POST["example_name"]="testing";

But i want to know the excact command line in linux to do that operation.

something like
wget --post-data=STRING www.url.com

but with the corect syntax.

thnx

py9jmas

11:32 am on Sep 8, 2004 (gmt 0)

10+ Year Member



I don't think it can be done with wget. If you hace curl installed though:


curl -d example_name=testing http://www.example.com/test.php

See

man curl

for more information. Also check the -F option.

Hevymetal

6:16 pm on Sep 8, 2004 (gmt 0)

10+ Year Member



I don't have installed curl and don't want to.
With wget in linux it is quite easy to accomplish that.

With the excact info:

wget --post-data 'example_name=testing' www.url.com

But with that method i get problems in PHP functions exec and popen.
Error comes with --post-data ' ' -- i think it gets confused because of the coates.

Allso i don't want to save it to a file with wget.

I am really interested - how to do that(-post_data) with lynx.