Jump to content

[SOLVED] Auto Fill Forms?


onenonly

Recommended Posts

using post fields..

something like this (untested)

$URL = "http://example.com";
$POSTFIELDS = 'field1=111&field2=222';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

$result = curl_exec ($ch);
curl_close ($ch); 
print 	$result;	

 

See CURL manual for full details

opps so sorry but im very thankful but i kinda found it myself  ;D

i didnt understand what u meant

 

<?php

/*************************************
Copyright 2007 WageRank
http://www.wagerank.com
*************************************/

$username="YOURUSERNAMEGOESHERE";
$password="YOURPASSWORDGOESHERE";


//No need to edit below this line



//This is the info I pulled out of the LiveHTTPHeaderWindow
$loginURL = "http://technorati.com/login.php";
$loginFields = "username=$username&password=$password";

//Now we just submit the form to login
hitForm($loginURL, $loginFields);

//Here we add WageRank to our favorites
$favoritesURL = "http://technorati.com/faves/$username";
$favoritesFields = "add=http%3A%2F%2Fwww.wagerank.com&tag=%22online+marketing%22+seo+sem+%22affiliate+marketing%22";
hitForm($favoritesURL, $favoritesFields, "http://technorati.com/faves/$username?add=http://www.wagerank.com");

//Now we load our list of favorites and display it.
print hitPage("http://technorati.com/faves/$username");

//That's it! Below are the two function definitions we used.

function hitPage($page) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
        curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
        curl_setopt($ch, CURLOPT_URL, $page);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $ret = curl_exec($ch);
        curl_close($ch);
        return $ret;
}


function hitForm($loginURL, $loginFields, $referer="") {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
        curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
        curl_setopt($ch, CURLOPT_URL, $loginURL);
        curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $loginFields);
        $ret = curl_exec($ch);
        curl_close($ch);
        return $ret;
}


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.