inframe webpage(serverstatus) on mainpage

Discussion in 'PHP' started by shinyo, May 14, 2007.

  1. #1
    I would like to add a serverstatus of this type :
    status.hlstats.net/?ip=81.19.219.17:27015&qport=&game=hl&tpl=m&pic
    (if needed i can easily get the php code for this, no idea though how to integrate it in my index.php)
    to my page itself, on this spot :
    img.photobucket.com/albums/v381/kaitenvsshinyo/website1.jpg
    the php-code on that particular spot :
    img.photobucket.com/albums/v381/kaitenvsshinyo/website2.jpg

    So my question is, what is the php code, or what do I need to do to get the serverstatus in frame on the place specified in "website1.jpg"

    What I've tried (for several hours, only 'learned' php like yesterday) :
    - html integration in the index.php
    - writing my very own 'serverstatus.php' with the php code in it, then 'include' it at the given spot
    - numerous other things that probably make no sense and if I told them I would get laughed at :eek: :)

    thanks a lot in advance
     
    shinyo, May 14, 2007 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    just putting <?=file_get_contents('http://status.hlstats.net/?ip=81.19.219.17:27015&qport=&game=hl&tpl=m&pic') ?> in whatever part of the html you want it to be shown should do, for instance ....

    
    <html>
    <body>
    	<table>
    	<tr>
    		<td><?=file_get_contents('http://status.hlstats.net/?ip=81.19.219.17:27015&qport=&game=hl&tpl=m&pic') ?></td>
    	</tr>
    	<tr>
    		<td>Other content this side</td>
    	</tr>
    	</table>
    </body>
    </html>
    
    PHP:
     
    krakjoe, May 14, 2007 IP
  3. shinyo

    shinyo Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    can I just add html content to a php script?? (im a newb i guess) could you like kind of 'ingegrate' that posibility into the screenshot 'website2.jpg' ? :$ dont want you to do my homework, just havent got a clue how to do it :/

    php code of the serverstatusbox as shown in the top website:

    <?php echo file_get_contents('http://beta.status.hlstats.net/?game=hl&ip=81.19.219.17&qport=27015&tpl=m&pic'); ?>
     
    shinyo, May 14, 2007 IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    where you have <tr></td> three times you want that to span three columns with colspan=3 and then put <?= blah blah ?> in the cell, I'm on a mobile phone right now, it's hard enough to write code
     
    krakjoe, May 14, 2007 IP
  5. shinyo

    shinyo Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    problem solved with an iframe :
    code:
    --------------------------------------------------------------------------------
    <iframe width=150 height=250 scrolling=no border=0 frameborder=0 src=http://status.hlstats.net/?ip=81.19.219.17:27015&qport=&game=hl&tpl=m&pic></iframe>


    tnx for reading + your time, xxx
     
    shinyo, May 14, 2007 IP