0

BASIS:

I'm trying to create a web application where I can accept tickets and requests from multiple other external domains/URL's with a simple click of a button.

To accept a request/ticket you need to -as of now- enter the page's URL -> click a button/link to accept -> DONE!

This is doable for URL's where the "button" is either a link like <a href='performAccept'> or a form like <form action='performAccept'>.
Because then I can simply use $html = get_content_of_url($url); And look for these <a> or <form> and copy the url of these tags.

Now to the question and the tricky part. Sometimes there are no links nor forms, and instead a <input type='submit> and it has no URL connected to it.

QUESTION: Can I somehow enter a website which contains almost only of an <input type='submit'> and simulate a "click" as if I had the URL to the "click's" destination?

I would prefer to solve this using PHP. But Python is also an option.

mr k
  • 185
  • 11

1 Answers1

0

You cannot simulate a click. What you could do is:

POST the form with all the necessary fields via CURL. Solid websites have CSRF tokens. So I guess you wont be able to do so easily.

Here is an example to it: PHP + curl, HTTP POST sample code?

bro
  • 31
  • 6