Location: PHPKode > scripts > Valve RCON > valve-rcon/example/example.php
<html>
<head>
<title> Valve RCON Example </title>
</head>
<body>
<h1> CS 1.6 Example </h1>
<h2> General Usage </h2>
<pre>
<?php
include('../valve_rcon.php');
$r = new Valve_RCON('hiworld', '121.45.193.22', 27015, Valve_RCON::PROTO_CLASSIC);

$r->connect();
$r->authenticate();
echo $r->execute('status');
$r->disconnect();
?>
</pre>
<h2> Traditional Lazy Usage </h2>
<pre>
<?php
echo $r->execute('status');
?>
</pre>

<h1> CSS Example </h1>
<h2> General Usage </h2>
<pre>
<?php
$r = new Valve_RCON('hiworld', '121.45.193.22', 27016, Valve_RCON::PROTO_SOURCE);

$r->connect();
$r->authenticate();
echo $r->execute('status');
$r->disconnect();
?>
</pre>
<h2> Traditional Lazy Usage </h2>
<pre>
<?php
echo $r->execute('status');
?>
</pre>
</body>
</html>
Return current item: Valve RCON