Feeds:
Posts
Comments

Archive for January, 2010

VbCrLf di PHP

simple script untuk replace [new line – enter] menjadi <br> di PHP :

$tampil = preg_replace(‘/(\r\n|\n|\r|\f)/U’, “<br />”, $text);

example :

<?php

$t = $_POST[‘test’];

$tampil = preg_replace(‘/(\r\n|\n|\r|\f)/U’, “<br />”, $t);
echo ‘test : ‘. $tampil;

?>
<html>
<head>
<title>test</title>
</head>
<body>

<form name=”test” method=”post” action=”test.php”>
ini inputnya : <br>
<textarea name=”test” rows=”20″ cols=”80″></textarea><br>
<input type=”submit” value=”submit” name=”submit”><br><br><br>
</form>

ini hasilnya : <br>
<textarea name=”test2″ rows=”20″ cols=”80″><?=$tampil?></textarea><br>
</body>
</html>

Read Full Post »

Windows server 2000/2003 allows two remote terminal services connections for administrative purposes. Every once in a while I’ll get the “You exceeded the allowed connection count” message when trying to connect to a server via RDP, because previous sessions were not disconnected correctly. You can use either of the following methods to remotely disconnect Terminal Server sessions. Method 1 You can normally run the Terminal Services Manager program on another server, or even from a Windows XP workstation, to disconnect Terminal Services connections by clicking Start – Run and then typing %SystemRoot%\system32\tsadmin.exe This will launch the local copy of Terminal Services Manager. Next right click on All Listed Servers and select Connect to Computer. Type in the name or IP address of the server you wish to manage.

Read Full Post »