Jump to content

ajsuk

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by ajsuk

  1. hehe yeah, but I cant specify which set of results I want to go where in the page. Thats the aim of what I wanted it do. With the original code it'll just print the entire list of results wherever I paste the $server &/or $server... I want to be able to tell it to split up the results from each server as they come in so that I can place bits in table cells perhaps rather than the entire thing printing in one cell.  :) As I mentioned before I found one way of doing this was to edit the: [code]$data = explode('|',$server_data[$i]); To -> $data = explode('|',$server_data[0]); editing the $i to 0, 1, 2, 3 etc...[/code] For whichever server but then I'd have to copy the entire code out again when I want a result from a different server.
  2. That doesn't seem to do anything... Also that would just be the status, how do I get it to print the name of the server too? The servers each have a name, not just server: one, two or three, that was just an example, the original code also prints the name.
  3. I'm not too sure what your edited version is supposed to do, akitchin. Sorry I'm still fairly new at this stuff.  :(
  4. Sorry about that, I'll try to be more clear on how I want it to format the results. When it prints the server info ("echo $server .' - '. $status .'<br >';") its just a row for each server with the status Server one - UP Server two - CLOSED Server three - CLOSED etc... Now I can see how to seperate the server and the status with the echos "echo $server" or "echo $status" but not each set of them because all it'll do is print, start a new line and repeat.  ;) Is there a way to group them in to a kind of set to that I can call for it to print results from whichever set, 1, 2, 3, 4 etc... Like a echo $server from set #3 would print the server name from the 3rd set of results.
  5. Hey, I've been playing with a script that displays the status of some game servers. Here it is, first off as given out by the game company: [code] <?php //////////////////////////////////////////////////////////// // Insert this code in your page to get the server status // //////////////////////////////////////////////////////////// // retrieve information from Ryzom's website $server_data = file('http://atys.ryzom.com/serverstatus/status.php'); for ($i = 0; $i < sizeof($server_data); $i ++) { $data = explode('|',$server_data[$i]); $server = $data[0]; $status = 'CLOSED'; switch($data[1]) { case 1:  $status = 'OPEN'; break; case 2:  $status = 'LOCKED'; break; } echo $server .' - '. $status .'<br>'; } ?> [/code] This is all well and good, it'll produce a list of all the servers along their status. What I want to do though is format the results in tables etc in my page. I found I could edit the "$i" to "0", "1", "2" on so on to make it just produce results for one server and then repeat the entire code down the page for each server but that seems a little messy and overcomplicated. Is there a way I can edit it so that I can tell it to echo the _name_ and then the _status_ of each server without having almost the exact same code pasted all over the page? Thanks in advance for any help! -Andy.
  6. hehe, well thats much more simple, and works! Thankies very much!
  7. Ok I tried the second example but without much success.  :( I changed the "football" subdomain and the "baseball" pageid to what they really needed to be. Then changed the "filename.php" to "index.php" which is what the filename is there, ofcourse, but this didn't work. :( I guessed I'd perhaps have to put in the full URL or Path to the index file... Both of these did display the index.php file but it didn't set the pageid to "baseball". Any idea what could be wrong? Thanks again.
  8. [quote author=micah1701 link=topic=99835.msg393412#msg393412 date=1152326670] although, why do you want people looking for football to go to a baseball page? [/quote] hehe, yeah, bad example... But anyway thanks very much for the speedy reply, will give it a try and get post back.  ;)
  9. Hey there, as you'll guess from my post count I'm as noob as they come but I'll try to be as clear as pos. ;) I've recently started getting in to learning PHP and have modified my website to work using the php include linking functions... I managed to get it working well but as soon as I tried to use it with my subdomains I hit a brick wall.  :( If you imagine my website is sports.com. Here is what I'd like to do: If somebody visits http://football.sports.com, I would like them to be redirected to http://sports.com?pageid=baseball BUT without the new address being visible, so http://football.sports.com still appears in their browser address bar. Is this posible? Thanks in advance for any help you can give! Andy.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.