im working on a project for basically my friends and i to use. Maybe to use it for other games as well. SpeedRunning! i have made and was able to POST the Data into MySQL with THIS information
<?php include_once('include/action_page.php');?>
<!DOCTYPE HTML>
<meta charset="UTF-8">
<html>
<head>
<title>Roleplayer's Tavern Home</title>
<link href="/style/style.css" rel="stylesheet" type="text/css">
<script src="/include/jquery-1.11.2.min.js"></script>
<?php include_once('/include/rpt_site_no_script.php');?>
</head>
<body onload="">
<div class="page_container" name="page_container">
<div id="page_header">
<!-- The title of the webpage -->
<div style="max-width:250px; overflow:hidden">
<span id="header_title"><img src="style/logo.png" style="width:225px; height:67px;"/></span>
</div>
</div>
<!-- Left side bar -->
<div id="page_container_left">
<h3 id="page_content_header">Submit your data!</h3>
<?php include('include/submit_data.php');?>
</div>
<div id="page_container_right"
style="overflow-y: auto; max-height: 100%">
<h3 id="page_content_header">Donations for website?</h3>
<?php
?>
</div>
<!-- Main Content -->
<div id="page_content_container_main_page">
<div class="page_content_container">
<h2 id="page_content_container_header">Leaderboard WOO WOO</h2>
<hr>
<p id="page_content_container_content">
<h2>Players That Have Beaten Mad Pack 2</h2>
<?php include('include/leaderboard.php');?>
</div>
</div>
<br>
<!-- Footer -->
<div id="page_footer">
<ol id="footer_list">
<li>Copyright © Roleplayer's Tavern 2015-2016 - All Rights Reserved</li>
<li style="font-size:12px">Your IP address <?php echo $_SERVER['REMOTE_ADDR']; ?> will be logged for security reasons.</li>
</ol>
</div>
</div>
<script type="text/javascript">
var element=document.getElementsByName('page_container')[0];
var applyTo=document.getElementById('page_container_left');
var applyTo2=document.getElementById('page_container_right');
applyTo.style.height = (element.offsetHeight - 2) + "px";
applyTo2.style.height = (element.offsetHeight - 2) + "px";
window.onresize = function(event) {
var element=document.getElementsByName('page_container')[0];
var applyTo=document.getElementById('page_container_left');
var applyTo2=document.getElementById('page_container_right');
applyTo.style.height = (element.offsetHeight - 2) + "px";
applyTo2.style.height = (element.offsetHeight - 2) + "px";
}
</script>
</body>
</html>
as this is the HTML format.
Action_page.php is the page for submitting the information
<?php
$servername = "localhost";
$username = "USERNAME";
$password = "PASSWORD";
$mysqlDatabaseName = "SpeedRun";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $mysqlDatabaseName);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
$sql = "INSERT INTO MineCraftRecords (MineCraftName, LevelSeed, Day, Time)
VALUES ('$_POST[MinecraftName]', '$_POST[LevelSeed]', '$_POST[Day]', '$_POST[Time]')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Turtle Mode Activated";
$conn->close();
?>
<meta http-equiv="Location" content="https://rptavern.org/SpeedRun/">
and im having trouble on getting the page to LOAD the information provided into the leaderboard.php as this is what i have so far.
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
$servername = "localhost";
$username = "USERNAME";
$password = "PASSWORD";
$mysqlDatabaseName = "SpeedRun";
$query="SELECT * FROM MineCraftRecords";$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;while ($i < $num) {CODE$i++;}
$variable=mysql_result($result,$i,"fieldname");
$field1-name=mysql_result($result,$i,"MineCraftName");
$field2-name=mysql_result($result,$i,"LevelSeed");
$field3-name=mysql_result($result,$i,"Day");
$field4-name=mysql_result($result,$i,"Time");
$field5-name=mysql_result($result,$i,"id");
// Create connection
$conn = mysqli_connect($servername, $username, $password, $mysqlDatabaseName);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Turtle Mode Activated";
?>
Im basically trying to base it off this website http://www.speedrun.com/mc but not as technical. Just to show the SpeedRunning time and have the TIME the top of the list.
Any help is awesome, as im very new to creating stuff like this. i will take the time to read everyone's comments and suggestions that you all can provide :D