Well, I'm trying to make a character maker for my MMORPG Puzzle Pirates Private Server Development (MMORPGPPPSD for Short) and so far I have the form:
and the process.php for it:PHP Code:<?
session_start();
if($_SESSION['img_number'] != $_POST['number']){
echo "number doesn't match"
}else{
echo "Yay, The Numbers match"!
}
?>
<html><body>
<h4>The First Puzzle Pirates Private Server Character Creator!</h4>
<form action="process.php" method="post">
Name: <input name="ch" type="text" /><br>
Password: <input name="pass" type="password" />
Are you a robot?<br> <img src="image.php" alt="Random Number"><br>
Enter the number in the image: <input type="text" name="number">
<input type="submit" />
</form>
</body></html>
The verification image code:PHP Code:<html><body>
<?php
include("hostinfo.php");
$charactername = $_POST['ch'];
$pass = $_POST['pass'];
echo "Congrats, ". $charactername . " You're account has been created with the password " . $pass . ".<br />";
echo "If you have any problems with this account creation, please contact us at:";
?>
</body></html>
and now I just need the hostinfo.php to work, It will need to make it so that it makes a new character file in the server files that will look like this template:PHP Code:<?php
header("Content-type: image/png");
$num = "0123456789";
$one = rand(0, 9);
$two = rand(0, 9);
$three = rand(0, 9);
$four = rand(0, 9);
$five = rand(0, 9);
$six = rand(0, 9);
$number = $num{$one}.$num{$two}.$num{$three}.$num{$four}.$num{$five}.$num{$six};
$img_handle = ImageCreate (60, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate($img_handle, 255, 255, 255);
$txt_color = ImageColorAllocate($img_handle, 0, 0, 0);
ImageString($img_handle, 31, 5, 5, $number, $txt_color);
Imagepng($img_handle);
session_start();
$_SESSION['img_number'] = $number;
?>
Thanks :)PHP Code:[ACCOUNT]
character-username = $ch
character-password = $pass
[CHARACTER]
character-height = 0
character-posx =
character-posy =
character-rights = 0
character-ismember = 3
character-messages = 0
character-lastconnection =
character-lastlogin =
character-energy =
character-gametime = 0
character-gamecount =
[EQUIPMENT]
character-equip = 0 -1 0
character-equip = 1 -1 0
character-equip = 2 -1 0
character-equip = 3 -1 0
character-equip = 4 -1 0
character-equip = 5 -1 0
character-equip = 6 -1 0
character-equip = 7 -1 0
character-equip = 8 -1 0
character-equip = 9 -1 0
character-equip = 10 -1 0
character-equip = 11 -1 0
character-equip = 12 -1 0
character-equip = 13 -1 0
[LOOK]
character-look = 0 0
character-look = 1 7
character-look = 2 8
character-look = 3 9
character-look = 4 5
character-look = 5 0
[SKILLS]
character-skill = 0 1 0
character-skill = 1 1 0
character-skill = 2 1 0
character-skill = 3 1 0
character-skill = 4 1 0
character-skill = 5 1 0
character-skill = 6 1 0
character-skill = 7 1 0
character-skill = 8 1 0
character-skill = 9 1 0
character-skill = 10 1 0
character-skill = 11 1 0
character-skill = 12 1 0
character-skill = 13 1 0
character-skill = 14 1 0
character-skill = 15 1 0
character-skill = 16 1 0
character-skill = 17 1 0
character-skill = 18 1 0
character-skill = 19 1 0
character-skill = 20 1 0
character-skill = 21 1 0
character-skill = 22 1 0
character-skill = 23 1 0
character-skill = 24 1 0
[ITEMS]
[BANK]
[FRIENDS]
[IGNORES]
[EOF]
