/
Advanced Interactions
Advanced Interactions
Authentication - submitForm() madl Function
On occasions when you are retrieving a page source into an Interaction you may require authorisation from a login form. This is often known as a "PassThru"...
To get around this issue you can use the "submitForm()" function in mADL. The mADL SubmitForm function can be used to:
- Fetch the form at the requested url.
- Submit the required parameters using a string containing the form name or a numeric value representing the form (0 can be used instead to select the first form found, 1 then next and so on.)
- Pass the array of values to the login form.
- Return the results of the fetch for additional formatting.
Here's an example:
$t->fetch("http://mywebsite.com/login.php"); $t->submitForm( 0, array( 'username'=>'myusername', 'passwd'=>'mypassword' ) ); // Then you can continue on with accessing the page by using the following: $t->fetch("http://mywebsite.com/tickets.php?status=".$args[0]); return $t->result;
For more information on the submitForm function - see the note here.
, multiple selections available,