[ previous ] [ next ] [ threads ]
 
 From:  "Noli Rafallo" <admin at data dot mydestiny dot net>
 To:  "'Ramon A. Darrow'" <rdarrow at worrad dot com>, <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] RE: Running command line PHP script
 Date:  Sun, 19 Mar 2006 13:38:23 +0800
Did you try this #!/usr/local/bin/php -q


-----Original Message-----
From: Ramon A. Darrow [mailto:rdarrow at worrad dot com] 
Sent: Sunday, March 19, 2006 12:32 PM
To: m0n0wall at lists dot m0n0 dot ch
Subject: [m0n0wall] RE: Running command line PHP script

> Let's see your PHP script /tmp/everydns-update.php

This is what is in /tmp/everydns-update.php:

#!/usr/local/bin/php
<?php 
$username = '**************';
$password = '**************';
$domain = '**************';

$auth = base64_encode("$username:$password");

$targethost = 'dyn.everydns.net';
$targetport = 80;
$version = '0.1';
$path = "/index.php?ver=$version&domain=$domain";

$timeout = 30;

$fp = fsockopen($targethost, $targetport, $errno, $errstr, $timeout);
if (!$fp) {
	echo "$errstr ($errno)<br />\n";
} else {
	$out = "GET $path HTTP/1.0\r\n";
	$out .= "User-Agent: everydns-update.php $version\r\n";
	$out .= "Host: $targethost\r\n";
	$out .= "Authorization: Basic $auth\r\n\r\n";

	echo $out;

	fwrite($fp, $out);
	while (!feof($fp)) {
		echo fgets($fp, 128);
	}
	fclose($fp);
}
?>

---------------------------------------------------------------------
To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch