<?php
$adres="http://forum.persiantools.com/login.php";
$postdata = "username=myusername&password=mypassword&submit=&action=do_login";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $adres);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_TIMEOUT, 3600);
$result = curl_exec($ch);
header("location:http://forum.persiantools.com");
curl_close($ch);
?>