I have 10 php files like
0.php , 1.php, 2.php etc
All those files contains an auth form which send two inputs username and password to itself via post.
After login there is a message displayed.
I am trying to write a script which fills out the login form for each page and then echo the message from each page on a new line.
I know that I can fill the form using wget or curl but I am not so sure how.
I tried with curl -u username:password /host/files/0.php but seems that it just displays the html output of that file.
I am thinking of writing a shell script which does the followind:
pages = [0.php; 1.php; etc...]
foreach page in pages
access page via curl or wget, fill in the form with username and password which are the same for all files
echo respons
newline
How can I achieve this?