- Thread starter
- #21
Hahaha i removed the ones with characters instead of numbers.I'm not listed, heh
Who are we?
We are minecrafts 3rd oldest server and the oldest challenge and parkour dedicated server in the world. Our map dates over 7.5 years and our server has had an uptime of 99%. We have over 250 challenges which will keep you occupied for months. All of our challenges have been created by our member base who have completed our hardcore maps. You yourself could one day be creating a challenge for our server if you ever achieve the green membership rank. For more information about zero.minr.org click here...
More information below.
Hahaha i removed the ones with characters instead of numbers.I'm not listed, heh
Hey @Chillers , if all the data is logged inside a text file, it would be very easy to use JavaScript to read the file and place the data into a table for the Internet. I have been working on web programming for the past couple of months and I am capable of probably helping you guys achieve this. One website I have been making is a portfolio website for a job I want to do. You can visit nicholaslac.com to see the website in the working so farI would love to write a script pulling this data and listing it on a website, but unfortunately my capabilities are limited when it comes to this. It' would also be great to intergrate a similar feature with timings.
<?php
//set the delimiter used in the data. If CSV, use ","
$delim = " ";
$myfile = fopen("file address", "r") ordie("Unable to open file!");
$dataarray = explode($delim,$myfile);
fclose($myfile);
$t = 0;
echo "<table><tr><th>Name</th><th>Points</th></tr>";
foreach($dataarray as $data)
{
if($t == 0)
{
echo "<tr><td>" . $data . "</td>";
$t = 1;
}
else
{
echo "<td>" . $data . "</td></tr>";
$t = 0;
}
}
?>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT name, points FROM database";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo"id: " . $row["Name"]. " - Name: " . $row["Points"]. "<br>";
}
} else {
echo"0 results";
}
$conn->close();
?>
<script>
function points(){
var x=document.getElementById("right");
x.innerHTML ='<?php include_once "include.php";?>';
}
points();
</script>
I believe the data is automatically inserted into whatever storage file automatically by the plugin. The main issue would be file access. In the case of files used by the server, javascript alone is not a good idea for security reasons. Using PHP to pull the data with one page and javascript on a separate page to be able to refresh the data would be a far better idea.
For example:
if it is a text document:
if it is in a database format:PHP:<?php //set the delimiter used in the data. If CSV, use "," $delim = " "; $myfile = fopen("file address", "r") ordie("Unable to open file!"); $dataarray = explode($delim,$myfile); fclose($myfile); $t = 0; echo "<table><tr><th>Name</th><th>Points</th></tr>"; foreach($dataarray as $data) { if($t == 0) { echo "<tr><td>" . $data . "</td>"; $t = 1; } else { echo "<td>" . $data . "</td></tr>"; $t = 0; } } ?>
withPHP:<?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT name, points FROM database"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo"id: " . $row["Name"]. " - Name: " . $row["Points"]. "<br>"; } } else { echo"0 results"; } $conn->close(); ?>
Would need some cleaning up, but it would be a bit more secure.Code:<script> function points(){ var x=document.getElementById("right"); x.innerHTML ='<?php include_once "include.php";?>'; } points(); </script>