$image = file_get_contents('http://www.url.com/image.jpg');
file_put_contents('/images/image.jpg', $image);
Send Mail using mail function in PHP
<?php
$to = "
[email protected]";
$subject = "getph[.net";
$body = "Body of your message
$headers = "From: Peter\r\n";
$headers .= "Reply-To:
[email protected]\r\n";
$headers .= "Return-Path: info@ programmershelp.net \r\n";
$headers .= "X-Mailer: PHP5\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to,$subject,$body,$headers);
?>
HTTP Redirection
<?php
header('Location: http://you_stuff/url.php'); // stick your url here
?>
Human Readable Random String
/**************
*@length - length of random string (must be a multiple of 2)
**************/
function readable_random_string($length = 6){
$conso=array("b","c","d","f","g","h","j","k","l",
"m","n","p","r","s","t","v","w","x","y","z");
$vocal=array("a","e","i","o","u");
$password="";
srand ((double)microtime()*1000000);
$max = $length/2;
for($i=1; $i<=$max; $i++)
{
$password.=$conso[rand(0,19)];
$password.=$vocal[rand(0,4)];
}
return $password;
}
PHP resources