Hello Everyone,
I am very new to PHP programming. I have written very simple shell scripts. I am not a programmer. I need to whip up a very simple script to display a website if a rep is logged on or not.
I have a Bomgar appliance and I can send it commands and obtain the output in XML format.
Here is my PHP script that I ran when I am not logged on the Bomgar box:
<?php
$request_url = "my_url";
$xml = simplexml_load_file($request_url) or die("feed not loading");
var_dump($xml);
?>
Here is the output of the PHP script:
object(SimpleXMLElement)#1 (1) { [0]=> string(1) " " }
Here is the output of the PHP script when I am logged onto Bomgar box:
object(SimpleXMLElement)#1 (1) { ["rep"]=> object(SimpleXMLElement)#2 (6) { ["@attributes"]=> array(1) { ["id"]=> string(1) "1" } ["display_name"]=> string(6) "Dustin" ["direct_link"]=> object(SimpleXMLElement)#3 (1) { ["a"]=> string(6) "Dustin" } ["logged_in_since"]=> string(16) "04/29/2010 22:47" ["presentation_count"]=> string(1) "0" ["support_session_count"]=> string(1) "0" } }
How can I determine if "Dustin" is logged on or not? I would like to display an URL when I am not logged on and a different URL when I am logged on.
I hope this makes sense and this can be accomplished very easily! I am just confused on how to read the "SimpleXMLElement" output.
Thank you
Dustin