Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating Browser Clicks In PHP

Tags:

php

I want to write a PHP script that performs a routine task in a web app I use. I am trying to figure out the easiest way to submit a form, click a link, and get some information. What's the easiest way to do this (keeping the session open, etc.).

like image 607
Alex Avatar asked May 09 '26 06:05

Alex


2 Answers

Javascript would be a better solution than PHP. You can use it in tandem with PHP to submit a form that references the same page, ie. <form method='index.php' action='post'>

like image 101
Robert Avatar answered May 10 '26 21:05

Robert


If method is GET then you ought to be able to work it out form the URLs of a few real world attempts.

It POST then you are probably SOL unless it's your own web page./app and you know what $_POST it expects ... unless you find a tool to snoop your HTTP traffic and get the POST info from observing a few real wrold examples.

like image 41
Mawg says reinstate Monica Avatar answered May 10 '26 19:05

Mawg says reinstate Monica



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!