Hi everyone..
I am extrememly new to all things related to PHP.. to be honest I dont know anything about it!
One of my projects at uni though it to create an online game with a leader board.
So far I have created my game (which includes scores in a dynamic text field) and I have used phpMyAdmin to create a table/database.
What I would like to know is how to I make it so the scores from my flash game go into this table? I have spent about 8 hours today viewing tutorials online but most of them are aimed at people who know a little about php so I dont have a clue whats going on!
so far I have created this small form that can be filled in online
html>
<head><title>Form</title>
</head>
<body>
<form action="inputdata.php" method="post" >
<p> What's your first name? <input type="text" name="myname"> </p>
<p> What's your last name?
<input name="mycity" type="text" id="mycity">
</p>
<p> <input type="submit" name="Submit" value="Submit"> </p>
</form>
</body>
</html>
this links to this:
<?php
include('connect.php');
$myname = $_POST["myname"];
$mycity = $_POST["mycity"];
if (!@mysql_select_db($dbName)) {
print ("Could not select database...");
exit;
}
if (($myname != "")&&($mycity != "")) {
$query = "INSERT INTO test3 (score,firstname,lastname) VALUES ('0','$myname', '$mycity')";
$result = @mysql_query($query);
if (!$result) {
print ("Could not insert data \n");
} else {
print ("Data added sucessfully \n");
}
}else{
print ("Please fill in both fields and <a href='form.html'>try again</a>.");
}
mysql_close();
?>
So now how to I get this into my flash game? The name of my table is 'test 3' if that helps?
I'm sorry but I dont know anything about this stuff so it will have to be explained in detail
Any help appreciated
Emma (stressed)