How to submit form on an php webpage from command line?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to submit form on an php webpage from command line?
# 1  
Old 02-06-2014
Power How to submit form on an php webpage from command line?

Hello,

i have page domain.com/form.php

the form fields on form.php are named:

Code:
name=ipaddress
name=port

and submit button is named: submit

i want to ask how the linux command will look like to submit the form filled with:

ipaddress: 127.0.0.1
port: 80

I tried various curl and wget commands but no luck to get page and submit
# 2  
Old 02-06-2014
Code:
wget --post-data="field1=value1&field2=value2" site

Please show what 'various things' you try and exactly in what way they 'do not work'.
# 3  
Old 02-07-2014
Quote:
Originally Posted by Corona688
Code:
wget --post-data="field1=value1&field2=value2" site

I tried this and it appears it just downloading data to my computer instead submitting webform, im not sure Smilie
# 4  
Old 02-07-2014
All web page queries end up downloading something. That also uploads a POST query too, namely, "field1=value1&field2=value2".

You did change this to your needs, yes?

You did check your server for the necessary results, yes?

If not, both of those things would be a real great idea.
# 5  
Old 02-07-2014
Quote:
Originally Posted by Corona688
All web page queries end up downloading something. That also uploads a POST query too, namely, "field1=value1&field2=value2".

You did change this to your needs, yes?

You did check your server for the necessary results, yes?

Yes, i changed it to match my form field names and the file it downloaded is just php file with html content (source code) i dont know how more i can check results.

i found that in the form is another field like:
<input type="hidden" name="hobby" value="football">

but i did not mention this field in my command, not sure if its correct
# 6  
Old 02-07-2014
Yes, you need to mention that value, too.

If you don't know then I certainly don't. Sorry. All I can tell you is that it's going to download a .php file whether the form succeeds or not... Its contents might tell you whether it succeeded or failed. What is supposed to happen when you submit this form?

Last edited by Corona688; 02-07-2014 at 12:28 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trying to submit web form content to a shell script

Hi I was hoping some one could help me with a problem I have. I am trying to collect some information from a web form and save it to a text file. I found an example on this site that is sort of what I am trying to accomplish, the shell script bellow should echo the input back to the browser... (0 Replies)
Discussion started by: Paul Walker
0 Replies

2. Shell Programming and Scripting

Exec submit form in bash script

Hi All, I'm new in forum. Many congratulations to everyone for all work. I'm not an expert in bash script I've a problem with a sh file. The sh file run every t minuts and it read data from txt file and then compile form. Finally, the user, from the web browser click on send. The script... (0 Replies)
Discussion started by: Herbert
0 Replies

3. Programming

Html form to submit data to bash script

hi all, im going to design a web html form so users can input what username and password they want to make the ftp account, once they enter in a username and password they click on the submit button and it submits it to a bash script and then the bash script will run and finish of making the... (3 Replies)
Discussion started by: robertkwild
3 Replies

4. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies

5. Shell Programming and Scripting

Script to read command line input and change it to some form

Hi, I want to write a small code in which script changes command line input to some form. Example script.sh a1 a2 a3 a4 ..... output should be "a1|a2|a3|....." Number of inputs in command line can be any variable (2 Replies)
Discussion started by: Raza Ali
2 Replies

6. Shell Programming and Scripting

Can't submit a form.

hello my script is submitting POST-data to a site (its not my first script, i've done these before many times (include parsing scripts) but this one is tough) so the problem is i'm submitting a form with firefox and in firebug i see WHAT exactly i'm submitting then when i do EXACTLY the... (28 Replies)
Discussion started by: tip78
28 Replies

7. Shell Programming and Scripting

Using cURL to submit a post form

I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php . I have a list of about 1800 different species I want to check. For Example, choose the first species and use the... (2 Replies)
Discussion started by: hansvg
2 Replies

8. Shell Programming and Scripting

fetch last line no form file which is match with specific pattern by grep command

Hi i have a file which have a pattern like this Nov 10 session closed Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty . Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk . Nov 10 afrtetryytr Nov 10 session closed Nov 10 Nov 10 03:21:04 EST5EDT 2010 Dec 8 Nov 10 05:03:02 EST5EDT 2010 ... (13 Replies)
Discussion started by: Himanshu_soni
13 Replies

9. Shell Programming and Scripting

using wget to submit a form on linksys router

I'm trying to use wget to submit a form. I have tried to dig out what is actually being "posted" and where, using tamperdata (see below). http://ubuntuforums.org/attachment.php?attachmentid=109123&d=1239224127 Here is my wget command: wget --http-user=xyz --http-password=xyz... (1 Reply)
Discussion started by: mike909
1 Replies

10. Shell Programming and Scripting

PHP Help with Form Submit

Hi, I have a custom HTML form that has a couple radio buttons and a text field that requires a number. I'm not a php programmer and could use some help with putting together php code to calculate a total based on the radio button selection and the text field number. ... (3 Replies)
Discussion started by: nck
3 Replies
Login or Register to Ask a Question