I created an script that returns interface status from cisco router/switch. Now, i want to change the color of my text based on the word
Ex:
- connected=green
- notconnected=red
Is this possible ?
part of my script:
$host = "hostname";
$name = "my.username\r";
$pass = "mypassword\r";
$form = <<<END
<form method='post' action='' style='margin:auto; width:400px'>
Adresa IP host : <input type='text' name='host'><br><br>
<input type='submit' name='submit' value='Connect'>
</form>
END;
echo '<img src="\img\banner.jpg" style="margin:auto; display:block"/><br>';
echo $form;
$t = new TELNET();
if (!empty($_POST)){
$host = $_POST['host'];
echo("CONNECT:".$t->Connect($host, $name, $pass)."<br>");
echo("LOGIN:".(int)$t->LogIn());
echo("<br>Status Interfete:<br>");
$interfaces_status = ($t->GetOutputOf("show interface status"));
foreach ($interfaces_status as $value) {
echo "$value <br>";
PS: where can i post the script ? I bet there are alot of network engineers interested in this.