View Single Post
  #12  
Old 12-11-2011, 02:09 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
It would be better to just write the numbers to a file, and use that in your other code.

PHP Code:
<?php

$password 
$_REQUEST["pass"];
$key "1234567890";
if (
$password == $key) {
  
$file "playercount.txt";
  
$file fopen($file'w');
  
$player_count $_GET['players'];
  
$rc_count $_GET['rcplayers'];
  
fwrite($file"$player_count $rc_count");
  
fclose($file);
  echo 
"1";
} else {
  echo 
"INVALID PASSWORD";
}
?>
then in your other code you can use:

PHP Code:
<?php
  
  $data 
=  file_get_contents("playercount.txt");
  
$toks explode(" "$data);
  echo 
"Playercount: " $toks[0];
  echo 
"RCs: " $toks[1];

?>
Re-writing your index every time is just a huge waste.
__________________
Quote:
Reply With Quote