Saving I have working, to an extent.
PHP:
<?
$dbhost="localhost";
$dbusername="tibbius_Tiberath";
$dbpassword="**********";
$dbname="tibbius_tibgame";
switch($HTTP_GET_VARS['action'])
{
default:
{
echo("Nothing to see here.");
echo("<META http-equiv=\"REFRESH\" content=\"1; url=http://www.tibbius.com\">");
break;
}
case 'save':
{
$keyname = $HTTP_GET_VARS["keyname"];
$name = $HTTP_GET_VARS["name"];
$gender = $HTTP_GET_VARS["gender"];
$race = $HTTP_GET_VARS["race"];
$gold = $HTTP_GET_VARS["gold"];
$connect = mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($dbname,$connect) or die ("Could not select database");
$result = mysql_query("INSERT INTO `playerbase` VALUES ('$keyname', '$name', '$gender', '$race', '$gold')",$connect);
break;
}
case 'load':
{
break;
}
}
?>
Thats the PHP script I have, and it does the job like it's ment to.
CREATE TABLE `playerbase` (
`keyname` text NOT NULL,
`name` text NOT NULL,
`gender` text NOT NULL,
`race` text NOT NULL,
`gold` text NOT NULL
) TYPE=MyISAM;
Thats the SQL script for my table. It works with the PHP aswell.
mob
var
Race = "Elf"
Gold = "5124"
Sex = "Male"
mob
verb
test()
world.Export("http://www.tibbius.com/player.php?action=save&keyname=[src.key]&name=[src.name]&gender=[src.Sex]&race=[src.Race]&gold=[src.Gold]")
And thats the actual DM code.
Now, my question falls down to.
A: How do I make a working PHP Loading Script in which case will send the data back to DM.
B: How do I make DM read the data.
C: For Saving, How do I make it override an already existing reccord for the users $keyname?
I would be greatful for any help i can get. Thanks.
Load a script that posts the data in some fashion of: %name%Bob%name% then just parse the text in DM for the name. Use import I believe to get the data. Look into Volte's SiteParse demo.
Something like I believe would work.
Something to do with the way you set up the table. I don't remember though.
Hope this helps in some way.
-digitalRyno