Jump to content

salvador2001

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by salvador2001

  1. Got two work arounds, wich doesnt solve the original problem but it is better than zip. My guess is that there must be something wrong with the coding, it doesnt accept images for some reason i cant figure out... Damn... But i am creative, i have placed a background image top left and that image says, now playing (bla bla) Under the print $ i have put a img tag with a image wich says that the server is off-line. This page i loaded into a iframe with solid dimensions. Now, when there is no server, its got nothing to print and the first it will show on the page is the offline image. When there is a server, the script will print out its collected data and the image underneath it will shift down due to the text that is printed. Automaticly you can see the background image wich says the server is running plus the printed data. I hope you understand what i did. The second workaround is a extra script, also loaded in a iframe which only shows map images. But i didnt have found a secondary script wich can do that job. Thanks for youre effords to help me, and if you got any clou, please let me know ! Thanks again !
  2. only the regular server info... ??? is the extra script in the right position ? it is just a thougt... [code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>GameQ - Example script</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="refresh" content="9"> <style type="text/css"> * { font-size: 9pt; font-family: Verdana, sans-serif; } h1 { font-size: 9pt; } h2 { font-size: 10pt; } h3{ font-size:12px; font-weight:normal; margin:0; } table { border: 1px solid #000; background-color: #DDD; border-spacing:1px 1px; } table thead { font-weight: bold; background-color: #CCC; } table tr.uneven td { background-color:#FFF; } table td { padding: 5px 8px; } table tbody { background-color: #F9F9F9; } .note { color: #333; font-style:italic; } .key-always { color:red; font-weight:bold; } .key-normalise { color:red; } </style> </head> <body> <h2> </h2> <h1>24/7 Road to Jalalabad Robert Reed's House of A.I.D.S</h1> <h1>battlefield2</h1> <h3>Road To Jalalabad</h3> <h3>gpm_cq</h3> <h3></h3> <h3>69.12.98.120</h3>
  3. First of all, thanks that you ar willing to help me with this, i appreciate it very much ! Here is the code that is running at this moment: I correct a little type mismatch, and now it is showing nothing at all ! The error was in $map_image= array ( Originaly there was another string declared. ($map_plaatje..... ) <?php error_reporting(E_ALL); require_once 'GameQ.php'; // Define your servers, // see list.php for all supported games and identifiers. $servers = array( ' ' => array('bf2', '69.12.98.120', 29900), ); // Call the class, and add your servers. $gq = new GameQ(); $gq->addServers($servers); // You can optionally specify some settings $gq->setOption('timeout', 200); // You can optionally specify some output filters, // these will be applied to the results obtained. $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); // Send requests, and parse the data $results = $gq->requestData(); // Some functions to print the results function print_results($results) { foreach ($results as $id => $data) { printf("<h2>%s</h2>\n", $id); print_table($data); } } function print_table($data) { $gqs = array('gq_online', 'gq_address', 'gq_port', 'gq_prot', 'gq_type'); if (!$data['gq_online']) { printf(""); return; } print("<h1>$data[hostname]</h1>"); print("<h1>$data[gamename]</h1>"); print("<h3>$data[gq_mapname]</h3>"); print("<h3>$data[gq_gametype]</h3>"); print("<h3>$data[game_descr]</h3>"); print("<h3>$data[gq_address]</h3>"); $map_image= array ( 'zatar_wetlands' => 'zatar_wetlands.jpg', 'Road To Jalalabad' => 'road_to_jalalabad.jpg', ); // the code i inserted if(array_key_exisits($data['gq_mapname'], $map_image)) { $image = $map_image[$data['gq_mapname']]; } else { $image = 'noserver.jpg'; } echo '<img src="'.$image.'" />'; // End inserted code die(nl2br("Give us this output:\n".print_r($data, true))); foreach ($data as $key => $val) { if (is_array($val)) continue; $cls = empty($cls) ? ' class="uneven"' : ''; if (substr($key, 0, 3) == 'gq_') { $kcls = (in_array($key, $gqs)) ? 'always' : 'normalise'; $key = sprintf("<span class=\"key-%s\">%s</span>", $kcls, $key); } printf("", $cls, $key, $val); } print(""); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>GameQ - Example script</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="refresh" content="9"> <style type="text/css"> * { font-size: 9pt; font-family: Verdana, sans-serif; } h1 { font-size: 9pt; } h2 { font-size: 10pt; } h3{ font-size:12px; font-weight:normal; margin:0; } table { border: 1px solid #000; background-color: #DDD; border-spacing:1px 1px; } table thead { font-weight: bold; background-color: #CCC; } table tr.uneven td { background-color:#FFF; } table td { padding: 5px 8px; } table tbody { background-color: #F9F9F9; } .note { color: #333; font-style:italic; } .key-always { color:red; font-weight:bold; } .key-normalise { color:red; } </style> </head> <body> <?php print_results($results); ?> </body> </html>
  4. I think you ment the source code of the website page ? Here it is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>GameQ - Example script</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="refresh" content="9"> <style type="text/css"> * { font-size: 9pt; font-family: Verdana, sans-serif; } h1 { font-size: 9pt; } h2 { font-size: 10pt; } h3{ font-size:12px; font-weight:normal; margin:0; } table { border: 1px solid #000; background-color: #DDD; border-spacing:1px 1px; } table thead { font-weight: bold; background-color: #CCC; } table tr.uneven td { background-color:#FFF; } table td { padding: 5px 8px; } table tbody { background-color: #F9F9F9; } .note { color: #333; font-style:italic; } .key-always { color:red; font-weight:bold; } .key-normalise { color:red; } </style> </head> <body> <h2> </h2> <h1>24/7 Road to Jalalabad Robert Reed's House of A.I.D.S</h1><h1>battlefield2</h1><h3>Road To Jalalabad</h3><h3>gpm_cq</h3><h3></h3><h3>69.12.98.120</h3>
  5. I am not sure, my php experience is very poor. I tried but failed. Got any suggestions for this part ? please let me know. Thanks in advance.
  6. Hi, I tried it but i got no extra info than the usual things. (servername, type, map name and ip)
  7. else { $image = 'noserver.jpg'; } i think this is correct, i dont see an extra ' in it. But where should i put the printr command ?
  8. Hello, I am using a server status script from GameQ and it works fine. But i want to add some map pictures and i cant get it to work. I have added a little script into it, but somehow it wont work at all. I do hope someone can help me out on this, my knowledge of PHP is poor at this time. Here is the code, i have marked up the inserted part: <?php error_reporting(E_ALL); require_once 'GameQ.php'; // Define your servers, // see list.php for all supported games and identifiers. $servers = array( ' ' => array('bf2', '69.12.98.120', 29900), ); // Call the class, and add your servers. $gq = new GameQ(); $gq->addServers($servers); // You can optionally specify some settings $gq->setOption('timeout', 200); // You can optionally specify some output filters, // these will be applied to the results obtained. $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); // Send requests, and parse the data $results = $gq->requestData(); // Some functions to print the results function print_results($results) { foreach ($results as $id => $data) { printf("<h2>%s</h2>\n", $id); print_table($data); } } function print_table($data) { $gqs = array('gq_online', 'gq_address', 'gq_port', 'gq_prot', 'gq_type'); if (!$data['gq_online']) { printf(""); return; } print("<h1>$data[hostname]</h1>"); print("<h1>$data[gamename]</h1>"); print("<h3>$data[gq_mapname]</h3>"); print("<h3>$data[gq_gametype]</h3>"); print("<h3>$data[game_descr]</h3>"); print("<h3>$data[gq_address]</h3>"); $map_plaatje = array ( 'zatar_wetlands' => 'zatar_wetlands.jpg', 'Road To Jalalabad' => 'road_to_jalalabad.jpg', ); // the code i inserted if(array_key_exisits($data['gq_mapname'], $map_image)) { $image = $map_image[$data['gq_mapname']]; } else { $image = 'noserver.jpg'; } echo '<img src="'.$image.'" />'; // End inserted code foreach ($data as $key => $val) { if (is_array($val)) continue; $cls = empty($cls) ? ' class="uneven"' : ''; if (substr($key, 0, 3) == 'gq_') { $kcls = (in_array($key, $gqs)) ? 'always' : 'normalise'; $key = sprintf("<span class=\"key-%s\">%s</span>", $kcls, $key); } printf("", $cls, $key, $val); } print(""); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>GameQ - Example script</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="refresh" content="9"> <style type="text/css"> * { font-size: 9pt; font-family: Verdana, sans-serif; } h1 { font-size: 9pt; } h2 { font-size: 10pt; } h3{ font-size:12px; font-weight:normal; margin:0; } table { border: 1px solid #000; background-color: #DDD; border-spacing:1px 1px; } table thead { font-weight: bold; background-color: #CCC; } table tr.uneven td { background-color:#FFF; } table td { padding: 5px 8px; } table tbody { background-color: #F9F9F9; } .note { color: #333; font-style:italic; } .key-always { color:red; font-weight:bold; } .key-normalise { color:red; } </style> </head> <body> <?php print_results($results); ?> </body> </html>
  9. Exuse me for the late reply, i was in hospital. Thanks allot, it works fine now !
  10. Hello, I want to change this script for admin use. What i want is that you dont have to browse for an image, but is set to the dir where the image to be uploaded is. For example www.mysite.com/folder Also, if possible, i want an auto sumit. The idea is that an admin can call this script on a admin section of the website (that is no problem at all) and that the image will be uploaded automaticly. Can anyone help me out ? Thanks in advance, Greetings, Jack <html> <form enctype="multipart/form-data" action="<?print $_SERVER['PHP_SELF']?>" method ="post"> <tr><td><input type = "hidden" name="MAX_FILE_SIZE" value = "102400"></td></tr> <tr><td>Select File: </td><td><input type = "file" name = "fupload"><t/d></tr> <tr><td><input type = "submit" value = "Upload!"></td></tr> </table> <?php //checking and uploading file----------------------------------------------------------- if (isset ($_FILES['fupload'])){ $filename = $_FILES['fupload']['name']; $randomdigit = rand(0000,9999);//create random digit $newfilename = $randomdigit.$filename;//make new file name with random digit //printing file information print "<table>"; print "<tr><td>Original Name:</td><td> ". $_FILES['fupload']['name']."</td></tr>"; print "<tr><td>New Name:</td><td> ".$newfilename."</td></tr>"; print "<tr><td>Size: </td><td>". $_FILES['fupload']['size']."</td></tr>"; print "<tr><td>Temp Name: </td><td>". $_FILES['fupload']['tmp_name']."</td></tr>"; print "<tr><td>Type: </td><td>". $_FILES['fupload']['type']. "</td></tr>"; print "<tr><td>Error: </td><td>". $_FILES['fupload']['error']. "</td></tr>"; print "</table>"; //checking the type of file, if it is image it will display it if ($_FILES['fupload']['type'] == "image/jpeg"){ $source = $_FILES['fupload']['tmp_name']; $target = "upload/".$_SESSION['username']."/".$newfilename; move_uploaded_file($source, $target); // or die ("Couldnt copy"); //displaying the image $imagesize = getImageSize($target); $imgstr = "<p><img width=\"$size[0]\" height=\"$size[1]\" "; $imgstr .= "src=\"$target\" alt=\"uploaded image\" ></p>"; $imagepath = $yoursite.$target; print $imgstr; print "The link to your image is: ".$yoursite.$target;//link to the image } } //------------------------------------------------------------------------------------- ?> </html>
  11. Ahh thanks !! I replaced it and deleted the form field wich handles the question wich size it should be and it works perfect. I had changed the form field and didnt saw the declaration above it, stupid... Greetings, Jack
  12. Hi, I am still a newbie at PHP and i am stuck. I found this script on the internet wich works fine but there is one thing i would change, but cant get it done. The problem with this upload and resize script is that i dont want the client to be able to edit the resize values. I would like to set it to 400 x 300. Can this be done ? i would be thankfull if someone can help me out here. <?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?> <?php // upload the file if ((isset($_POST["submitted_form"])) && ($_POST["submitted_form"] == "image_upload_form")) { // file needs to be jpg,gif,bmp,x-png and 4 MB max if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg" || $_FILES["image_upload_box"]["type"] == "image/gif" || $_FILES["image_upload_box"]["type"] == "image/x-png") && ($_FILES["image_upload_box"]["size"] < 4000000)) { // some settings $max_upload_width = 2592; $max_upload_height = 1944; // if user chosed properly then scale down the image according to user preferances if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']<=$max_upload_width){ $max_upload_width = $_REQUEST['max_width_box']; } if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']<=$max_upload_height){ $max_upload_height = $_REQUEST['max_height_box']; } // if uploaded image was JPG/JPEG if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){ $image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]); } // if uploaded image was GIF if($_FILES["image_upload_box"]["type"] == "image/gif"){ $image_source = imagecreatefromgif($_FILES["image_upload_box"]["tmp_name"]); } // BMP doesn't seem to be supported so remove it form above image type test (reject bmps) // if uploaded image was BMP if($_FILES["image_upload_box"]["type"] == "image/bmp"){ $image_source = imagecreatefromwbmp($_FILES["image_upload_box"]["tmp_name"]); } // if uploaded image was PNG if($_FILES["image_upload_box"]["type"] == "image/x-png"){ $image_source = imagecreatefrompng($_FILES["image_upload_box"]["tmp_name"]); } $remote_file = "uploads/".$_FILES["image_upload_box"]["name"]; imagejpeg($image_source,$remote_file,100); chmod($remote_file,0644); // get width and height of original image list($image_width, $image_height) = getimagesize($remote_file); if($image_width>$max_upload_width || $image_height >$max_upload_height){ $proportions = $image_width/$image_height; if($image_width>$image_height){ $new_width = $max_upload_width; $new_height = round($max_upload_width/$proportions); } else{ $new_height = $max_upload_height; $new_width = round($max_upload_height*$proportions); } $new_image = imagecreatetruecolor($new_width , $new_height); $image_source = imagecreatefromjpeg($remote_file); imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height); imagejpeg($new_image,$remote_file,100); imagedestroy($new_image); } imagedestroy($image_source); header("Location: submit.php?upload_message=image uploaded&upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]); exit; } else{ header("Location: submit.php?upload_message=make sure the file is jpg, gif or png and that is smaller than 4MB&upload_message_type=error"); exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Image Upload with resize</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; color: #333333; font-size: 12px; } .upload_message_success { padding:4px; background-color:#009900; border:1px solid #006600; color:#FFFFFF; margin-top:10px; margin-bottom:10px; } .upload_message_error { padding:4px; background-color:#CE0000; border:1px solid #990000; color:#FFFFFF; margin-top:10px; margin-bottom:10px; } --> </style></head> <body> <h1 style="margin-bottom: 0px">Submit an image</h1> <?php if(isset($_REQUEST['upload_message'])){?> <div class="upload_message_<?php echo $_REQUEST['upload_message_type'];?>"> <?php echo htmlentities($_REQUEST['upload_message']);?> </div> <?php }?> <form action="submit.php" method="post" enctype="multipart/form-data" name="image_upload_form" id="image_upload_form" style="margin-bottom:0px;"> <label>Image file, maximum 4MB. it can be jpg, gif, png:</label><br /> <input name="image_upload_box" type="file" id="image_upload_box" size="40" /> <input type="submit" name="submit" value="Upload image" /> <br /> <br /> <label>Scale down image? (2592 x 1944 px max):</label> <br /> <input name="max_width_box" type="text" id="max_width_box" value="400" size="4"> x <input name="max_height_box" type="text" id="max_height_box" value="300" size="4"> px. <br /> <input name="submitted_form" type="hidden" id="submitted_form" value="image_upload_form" /> </form> <?php if(isset($_REQUEST['show_image']) and $_REQUEST['xshow_image']!=''){?> <p> <img src="uploads/<?php echo $_REQUEST['xshow_image'];?>" /> </p> <?php }?> Greetings, Jack
  13. Hello, I have this script and its working fine, but there is one thing i would like to change. When the server wich i am scanning is not online (shutted down completely) it takes 30 seconds until it shows the offline status. I would like to decrease this to 2 to 5 seconds and let the script the server is down. Can anyone tell me what i have to do, please a bit specific because i have poor knowledgde. [code]<?php set_time_limit(0);    $s_port  = 12203;              // Serverport  $s_ip    = "82.217.212.106";  // Server-IP  $timeout = 2;   // CONN WRITE READ [1] $s_con  = fsockopen("udp://".$s_ip, $s_port,$errno, $errstr, $timeout);  // $s_con == false if fsockopen failed  if(!$s_con)      die(msg_server('Unable to connect with fsockopen [1];; '.$errstr));  // fwrite return false on write error, else it return how many bytes written  if(fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00))===FALSE) die(msg_server('Unable to write to $_con [1]'));  // fread return false on read error, else it return the read string  if(($ffb = fread($s_con,4))===FALSE)          die(msg_server('Unable to read from $_con after write. [1]'));  // stream_get_meta_data is same as socket_get_status  $meta_data = stream_get_meta_data($s_con);  if($meta_data["unread_bytes"]==0) die(msg_server('server DOWN'));  $beginnen = fread($s_con, $meta_data['unread_bytes']);  fclose($s_con);  $data = explode("\n", $beginnen);  // Serverinfo  // CONN WRITE READ [2]  $s_con = fsockopen("udp://".$s_ip, $s_port,$errno, $errstr, $timeout);  if(!$s_con) die(msg_server('Unable to connect with fsockopen [2];; '.$errstr));  if(fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00))===FALSE) die(msg_server('Unable to write to $_con [2]'));  // bytes lezen en verbindingsopbouw  if(($ffb = fread($s_con,4))===FALSE) die(msg_server('Unable to read from $_con after write. [2]'));  $meta_data = stream_get_meta_data($s_con);  if($meta_data["unread_bytes"] == 0)      die(msg_server('No data, sorry. ('.$ffb.')'));  $beginnen = fread($s_con, $meta_data['unread_bytes']);  fclose($s_con);  msg_server('server ACTIVE');    function msg_server($server_status,$errmsg=''){      echo " <div class='scanner' id='hoofd'>   <div class='picture'><img src='sc-moh.gif' alt='1' /></div>   <div class='status'>$server_status</div> </div>";     } ?>[/code]
  14. hello, I have created a table for my script and its divided in two parts. The left part shows a picture and the right part shows the variable of the script. Now i have the problem that underneath the picture a space is showing up wich i cant remove. The table should be tight around the picture. Can anybody tell me how to remove this space ?     echo " <div align='left'> <table width='207' height='75' valign='top' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'> <tbody> <tr>     <td     colspan='1' width='50' style='text-align:left;font-weight:700;'>     <img src='sc-1.gif' />     </td>             <td style='text-align:center;font-weight:700;border-color:#2D3740;'>".$server_status."</td> </tr> </tbody> </table>         </div>";
  15. Problem solved. Thank you very much !
  16. So there isnt any solution ? All i want is that its detecting if the server is online or not, if so he has to determine if the game is played. If the server is not turned on it has to echo a message.
  17. Hi, I have posted a simular question before but my problem wasnt solved yet. This script is wachting if the server is playing or not. That part works fine, but when the host server is shutted down i get a fatal error: maximum time of 30 seconds exeeded .... How can i supress this error, or echo a message like host not active ? I have poor knowledge of PHP so i hope that someone can solve this for me, i would be very greatfull because this problem is keeping me buisy for at least 2,5 weeks now ! Here is the script: [code]<?php   $s_port  = 12203;              // Serverport  $s_ip    = "82.217.212.106";  // Server-IP  $timeout = 30;  // CONN WRITE READ [1] $s_con  = fsockopen("udp://".$s_ip, $s_port,$errno, $errstr, $timeout);  // $s_con == false if fsockopen failed  if(!$s_con)      die(msg_server('Unable to connect with fsockopen [1];; '.$errstr));  // fwrite return false on write error, else it return how many bytes written  if(fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00))===FALSE) die(msg_server('Unable to write to $_con [1]'));  // fread return false on read error, else it return the read string  if(($ffb = fread($s_con,4))===FALSE)          die(msg_server('Unable to read from $_con after write. [1]'));  // stream_get_meta_data is same as socket_get_status  $meta_data = stream_get_meta_data($s_con);  if($meta_data["unread_bytes"]==0) die(msg_server('No reply, or('.$ffb.')'));  $beginnen = fread($s_con, $meta_data['unread_bytes']);  fclose($s_con);  $data = explode("\n", $beginnen);  // Serverinfo  // CONN WRITE READ [2]  $s_con = fsockopen("udp://".$s_ip, $s_port,$errno, $errstr, $timeout);  if(!$s_con) die(msg_server('Unable to connect with fsockopen [2];; '.$errstr));  if(fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00))===FALSE) die(msg_server('Unable to write to $_con [2]'));  // reading bytes and test connection  if(($ffb = fread($s_con,4))===FALSE) die(msg_server('Unable to read from $_con after write. [2]'));  $meta_data = stream_get_meta_data($s_con);  if($meta_data["unread_bytes"] == 0)      die(msg_server('No data, sorry. ('.$ffb.')'));  $beginnen = fread($s_con, $meta_data['unread_bytes']);  fclose($s_con);  msg_server('Playing Mohaa or Spearhead');    function msg_server($server_status,$errmsg=''){      echo "<div align='left'>  <table width='20%' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'>    <tbody>      <tr>        <td colspan='3' style='text-align:center;font-weight:700;'>Picture here</td>      </tr>      <tr>        <td colspan='3' style='text-align:center;font-weight:700;'>Server Status</td>      </tr>      <tr>        <td style='text-align:center;font-weight:700;border-color:#2D3740;'>".$server_status."</td>        <td>Error: ".$errmsg."</td>      </tr>    </tbody>  </table>\n</div>";    } ?> [/code]
  18. I dont understand //insert normal code from above, i tried a few things but like i said, my knowledge is poor. if ($status = socket_get_status($s_con)) { fread($s_con, 4); $status = socket_get_status($s_con); } else {   echo "Server is down."; } I am sure its wrong because the script doesnt work like it should. Can you be more specific please sir ?
  19. Hello, I have a problem wich i cant solve because my knowledge of PHP is to little at this moment. So i hope someone can help me out with a problem and give me a clear solution. This script is working fine when the hosting pc is turned on. The script will clearly show if the game is running or not. But when the hosting pc is turned of i get a error on line 11 wich says: Fatal error: maximum execution time of 30 seconds.... on line 11. Can somebody help me with this ? Here is the script: [code]<?php $s_port = 12203;          // Serverport $s_ip  = "82.217.212.106";    // Server-IP $s_con = fsockopen("udp://".$s_ip, $s_port); fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00)); // testen verbindings opbouw fread($s_con, 4); $status = socket_get_status($s_con); // SERVER DOWN if($status["unread_bytes"] == 0) { echo "<div align='left'>   <table width='20%' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'>     <tr>       <td colspan='3'> <div align='center'><strong>Hier Plaatje</strong></div></td>     </tr>   <tr>       <td colspan='3'> <div align='center'><strong>server           status</strong></div></td>     </tr>      <tr bordercolor='#2D3740'>       <td align='center'><strong>Server down</strong></td>"; die(); } $beginnen = ""; do { $beginnen .= fread($s_con, 1); $status = socket_get_status($s_con); } while($status["unread_bytes"] != 0); fclose($s_con); $data = explode("\n", $beginnen); // Serverinformatie $s_con = fsockopen("udp://".$s_ip, $s_port); fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00)); // bytes lezen en verbindingsopbouw fread($s_con, 4); $status = socket_get_status($s_con); if($status["unread_bytes"] == 0) { echo "no info. sorry"; die(); } $beginnen = ""; do { $beginnen .= fread($s_con, 1); $status = socket_get_status($s_con); } while($status["unread_bytes"] != 0); fclose($s_con); echo" <div align='left'>   <table width='20%' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'>     <tr>       <td colspan='3'> <div align='center'><strong>hier plaatje</strong></div></td>     </tr>   <tr>       <td colspan='3'> <div align='center'><strong>server           status</strong></div></td>     </tr>      <tr bordercolor='#2D3740'>       <td align='center'><strong>Playing Mohaa or Spearhead</strong></td>"; ; ?> [/code]
  20. my purpose is that i can load pages from the members directory. like page1 and page2 so if i call it from the menu with [a href=\"http://www.mydomain.com/index.php?load=page1.php\" target=\"_blank\"]http://www.mydomain.com/index.php?load=page1.php[/a] it will appear. Now all i get is an error page 404. I do have great difficutltys learning the code.
×
×
  • 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.