Copy this code and paste it in your HTML
<?php
$host="localhost" ;
$port=12345;
$timeout=30;
$sk=fsockopen($host,$port,$errnum,$errstr,$timeout) ;
exit("connection fail: ".$errnum." ".$errstr) ;
} else {
fputs($sk, "hello world") ;
$dati="" ;
$dati.= fgets ($sk, 1024);
}
}
?>