Filling out and submitting html forms with php without user input?

Parse out the action attribute with a HTML parser, and use curl to perform a POST to the appropriate target URL.

Read the entire fire into a variable. Rather than using fopen you might want to consider file_get_contents for that, it's a bit cleaner. You'll then want to parse that string as HTML.

You could use PHP's DOMDocument for that. Get the action and method of the form by traversing the DOM tree to the form tag and reading out those attributes. Next get the names of any inputs within the form tags.

Use those names to generate a query string with your key=value pairs. If the method of the form is GET, then append that query string to the form action, otherwise save it in another variable. Finally, use CURL to "submit" the form.

That is, use the form action as the URL for a CURL request. If the form method was GET, you should have already appended the data to the URL, if the method was POST, you'll want to set the data for the CURL request to the data query string you generated from the form names. If your question extend to how to know what data to fill into what form fields, that is pretty much impossible to solve.

Certainly there are some input names you could look for and guess the required data but a universal solution is an impossible problem to solve.

If that's the case, you'll need to resort to javascript, something like: (insert form here) This will automatically submit the form. Some notes: not everyone has JavaScript enabled, so you might want to change the inputs to type="hidden", as well as add a nice big submit button that says Click Here.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions