#
###############################
*/
/* configuration */
$lcd['path'] = "/home/ed/www/lcd4web";
$lcd['size'] = "20";
$lcd['url'] = "http://ed.zehome.com/lcd4web";
$lcd['lines'] = "4";
$lcd['title'] = "Controle de mon ecran lcd a distance";
$lcd['textfile'] = $lcd['path'];
$lcd['textfile'] .= "/text";
$lcd['randomfile'] = $lcd['path'];
$lcd['randomfile'] .= "/img.random";
$lcd['logfile'] = $lcd['path'];
$lcd['logfile'] .= "/log.1";
$lcd['logfile2'] .= "log.1";
$lcd['original'] = $lcd['path'];
$lcd['original'] .= "/lcd.png";
if (! $str1 ) {
if ($sent == "1") {
echo "Vous devez remplir au moins un champ sur le lcd";
}
if (! $str2)
$str2 = " ";
if (! $str3)
$str3 = " ";
if (! $str4)
$str4 = " ";
$filename4 = $lcd['randomfile'];
$filename4 = file("$filename4");
$filename5 = chop("$filename4[0]");
echo "\n
\n\nLCD for Web\n
" .$lcd['title']. "
Actuellement sur le LCD:
Le LCD est il branché, et fonctionne t'il en ce moment: ";
$iptoopen="192.168.1.5";
$porttoopen = 13666;
$connection = fsockopen ($iptoopen, $porttoopen, &$errno, &$errstr, 1);
if (!$connection){
echo "non";
}else{
fputs($connection, "hello\n");
socket_set_timeout($connection, 1, 1);
echo "oui";
}
@fclose($connection);
echo "
\n
Nombres d'entrees dans le log:";
system("cat " .$lcd['logfile']. " | fgrep \"ip: \" | wc -l");
echo "
Consultez ce log, ICI";
echo "
";
echo "Sources ICIprogrammé par ed
";
} else {
system("echo \"$str1\" >" .$lcd['textfile']. "");
system("echo \"$str2\" >>" .$lcd['textfile']. "");
system("echo \"$str3\" >>" .$lcd['textfile']. "");
system("echo \"$str4\" >>" .$lcd['textfile']. "");
$date = date("d/M/Y H:i:s");
system("echo \"--\" >>" .$lcd['logfile']. "");
system("echo \"ip: $_SERVER[REMOTE_ADDR] && date: $date\" >>" .$lcd['logfile']. "");
system("echo \"+--------------------+\" >>" .$lcd['logfile']. "");
system("echo \"$str1\" >>" .$lcd['logfile']. "");
system("echo \"$str2\" >>" .$lcd['logfile']. "");
system("echo \"$str3\" >>" .$lcd['logfile']. "");
system("echo \"$str4\" >>" .$lcd['logfile']. "");
system("echo \"+--------------------+\" >>" .$lcd['logfile']. "");
$amplitude = "30";
$random=mt_rand(0,$amplitude);
$filename = $lcd['original'];
$filename3 = $lcd['path'];
$filename3 .= "/lcd_modified2.png";
$filename2 = $lcd['path'];
$filename2 .= "/lcd_".$random.".jpg";
system("echo \"".$random."\" >" .$lcd['randomfile']. "");
function lines($imgname) {
global $filename,$filename2,$lcd;
$filepath = $lcd['textfile'];
$str = file("$filepath");
$line1 = $str[0];
$line2 = $str[1];
$line3 = $str[2];
$line4 = $str[3];
$im = imagecreatefrompng ($imgname);
$tc = ImageColorAllocate($im, 0, 0, 0);
$line1 = chop($line1);
$string3 = "";
for($i=0,$index=0;$i
LCD for Web
Emulation de mon ecran LCD en php gd
Ce que vous avez ecrit sur le lcd en plain/text
";
echo "$str1
";
echo "$str2
";
echo "$str3
";
echo "$str4
";
echo "
";
echo "Sources ICI
<<<- Retour
programmé par ed