The download contains a "Davejax" extension, this can be used to make the AJAX call from GM to your PHP script. You say you know PHP/MySQL quite well, have you set up scripts to retrieve and send the name and score and have it do what you want? If you have that side sorted, the GM side is not hard to set up.
To get text from a user, use the variable "keyboard_string". When the player types something, whatever they type is stored in this variable. Use draw_text to draw it's value on the screen so the player can see what they are typing.
mysql_real_escape_string() is a sanitising function to stop hacking via SQL injection. It just adds escape characters before things like ' and " so if the player tries to trick your query into doing something it shouldn't then this helps to stop it.
string_tags() stops players from entering HTML code as a name, causing the page to display differently, or injecting javascript, etc.
Dave do you think we can exchange email address and get this sorted out? I have tried following this tutorial as well (
http://gmc.yoyogames...howtopic=520198) but still no luck. I don't need anything too complicated (as described) but I do need this for my PhD research.
I have the main page setup so that a user can enter a name and it is saved as a global variable called name (global.name). I have the database with the table called game, 2 columns (name, qc).
Basically once the user enters his/her name, I just want to get the qc value from that user name. If the name doesn't exist, then insert the name into the table. It is not that complicated, but I can't solve this with GM.
I am confused on what I need. I have a php file called dbcon.php that has
<?
// database variables
$dbHost = "localhost";
$dbName = "<name here>";
$dbUser = "<user here>";
$dbPass = "<password here>";
// database connection functions
function dbConnect() {
global $dbCon, $dbHost, $dbName, $dbUser, $dbPass;
$dbCon = mysql_connect($dbHost,$dbUser,$dbPass);
return mysql_select_db($dbName);
}
function dbClose() {
global $dbCon, $dbHost, $dbName, $dbUser, $dbPass;
mysql_close($dbCon);
unset($dbCon);
}
?>
What should my javascript file look like? Honestly, at this point I'll give anyone access to my DB and everything just to get this working. Thanks,
Mike