Skip to content

Commit

Permalink
Merge pull request #25 from SST-CTF/php
Browse files Browse the repository at this point in the history
Added basic MySQL integration
  • Loading branch information
Aqcurate authored Jan 27, 2017
2 parents 8795790 + 6b8db80 commit 14cceb4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@
.Trashes
ehthumbs.db
Thumbs.db

# MySQL Password #
password.php
6 changes: 5 additions & 1 deletion index.html → index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
</style>

<?php
// Include Password File
include 'password.php';

// define variables and set to empty values
$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";
Expand Down Expand Up @@ -207,10 +210,11 @@ <h4>FOOTER</h4>

echo "<h2>Your Input:</h2>";
echo $name;
echo $person;
echo "\n";

$servername = "localhost";
$username = "www";
$password = "[HIDDEN]"; // TODO: Remove password from index.php by calling password from another file
$dbname = "typing_test";

// Create connection
Expand Down
47 changes: 47 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,50 @@ function doCheck() {
beginTest(); // Yes, we should -- consider it done!
}
}


(htmlWidth = $("html").width();
$.ajax({
type: "POST",
url: "mobileView.php",
data:{ width: htmlWidth, somevar : "yes" },
success: function(data){
console.log(data);
}
}));

(function sendWPM($) {
var person = prompt('Please enter your name', '');
$.ajax({
type: 'POST',
url: './backend.php2',
data: { wpm: $("select[wpm='players']").val() },
success: function (msg) {
alert('Data Saved: ' + msg);
}
});
}(jQuery));

(function sendIssues($) {
var totalTime = prompt('Please enter your name', '');
$.ajax({
type: 'POST',
url: './backend.php2',
data: { issues: $("select[issues='players']").val() },
success: function (msg) {
alert('Data Saved: ' + msg);
}
});
}(jQuery));

(function sendAccuracy($) {
var = prompt('Please enter your name', '');
$.ajax({
type: 'POST',
url: './backend.php2',
data: { accuracy: $("select[accuracy='players']").val() },
success: function (msg) {
alert('Data Saved: ' + msg);
}
});
}(jQuery));

0 comments on commit 14cceb4

Please sign in to comment.