/* Redirect browser */
header("Location: http://theos.in/");
/* Make sure that code below does not get executed when we redirect. */
exit;
Posts Tagged ‘script sample’
A simple PHP redirect script
September 16th, 2009PHP — Remote WordPress posting function using XMLRPC
August 25th, 2009function wpPostXMLRPC ($title, $body, $rpcurl, $username, $password, $categories=array(1)) {
$categories = implode(",", $categories);
$XML = "$title".
"$categories".
$body;
$params = array('','',$username,$password,$XML,1);
$request = xmlrpc_encode_request('blogger.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_exec($ch);
curl_close($ch);
}
PHP — ‘Page last modified’ on script
July 20th, 2009<html>
<head>
<title>Page last updated on month/date/year hour:min PHP Script</title>
</head>
<?php
$last_modified = filemtime("myexamplepage.php");
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
</body>
</html>
