PHP Classes

File: remoteform.example.php

Recommend this page to a friend!
  Classes of Jon Gjengset   Remote Form   remoteform.example.php   Download  
File: remoteform.example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Remote Form
Retrieve HTML forms input values
Author: By
Last change:
Date: 14 years ago
Size: 377 bytes
 

Contents

Class file image Download
<?php
  $site
= file_get_contents('http://www.gmail.com');
 
$dom = new DOMDocument();
 
$dom->loadHTML($site);
 
$xpath = new DOMXpath($dom);
 
$form = new RemoteForm($xpath->query('//form[@name="gaia_loginform"]')->item(0));
 
$form->setAttributeByName('Email', 'me@gmail.com');
 
$form->setAttributeByName('Passwd', 'mypass');
 
var_dump($form->getParameters());
?>