Hey all, I am writing a join script that will let the user sign up to my site.
For some reason every time I click submit to submit the info, it will load up a page with a
<b>Warning</b>: MySQL cannot create UNIX something or another
I would give you the exact error but for some reason my server suddenly gave out.
That may be the reason for this error, but I doubt it.
Here is the code I am using:
<?php
require ("univvars.php");
print ("<head><title>Join the Dark Ages</title></head><body bgcolor=\"#000000\" text=\"#ffffff\"><center>");
mysql_connect($Host, $User, $Pass) or die("<p>Unable to open page! Please try again later. If problem persists, contact programmer at soldier_of_rome@hotmail.com.");
mysql_select_db($DBName) or die("<p>Unable to open page! Please try again later. If problem persists, contact programmer at soldier_of_rome@hotmail.com.");
print ("This is the join page. Please enter all information!<br><br>");
$Visitnum = "$Visitnm + 1";
if (!$Visitnm)
{
$Visitnm = 1;
print ("<form action=\"join.php\" method=POST>");
print ("Will you character be a boy or a girl?:<br>
<select name=\"Gender\" value=\"Gender\">
<option value=\"Male\">Male</option>
<option value=\"Female\">Female</option></select>
<br><br><input type=Submit name=\"Submit\" value=\"Submit\">");
}
if ($Visitnum == 2)
{
$Visitnm = 2;
print ("<p><form action=\"join.php\" method=POST>");
print ("<br>First Name:<br><select name=\"first\" value=\"first\">");
if ($Gender == "Male")
{
print ("<option>William</option>
<option>Kreagor</option>
<option>Bismarck</option>
<option>Heinrich</option>
<option>Lundwig</option>
<option>Edward</option>
<option>Jacob</option>
<option>Robin</option>
<option>Joseph</option>
<option>Frederick</option>
<option>John</option>
<option>Luke</option>
<option>Marc</option>
<option>Paul</option>
<option>Khadames</option>
<option>Justinian</option>
<option>Manuel</option>
<option>Craigus</option>
<option>Otto</option>
<option>Meredith</option>
<option>Leif</option>
<option>Kjeile</option>
<option>Renald</option></select>");
}
else
{
print ("<option>Margarret</option>
<option>Evette</option>
<option>Anna</option>
<option>Mary</option>
<option>Maria</option>
<option>Kate</option>
<option>Susanna</option>
<option>Helga</option>
<option>Olga</option>
<option>Harriet</option>
<option>Katlyn</option>
<option>Eve</option>
<option>Eva</option>
<option>Janet</option>
<option>Cassandra</option>
<option>Alice</option></select>");
}
print ("<form action=\"join.php\" method=POST>
<br><br>Last Name:<br>
<select name=\"second\">
<option>Duirinheart</option>
<option>Gallant</option>
<option>Smith</option>
<option>Draegon</option>
<option>Himmler</option>
<option>Rechburg</option>
<option>Bernard</option>
<option>Molokovich</option>
<option>Lindemann</option>
<option>Lütjens</option>
<option>Drognan</option>
<option>Geglash</option>
<option>Aurelian</option>
<option>Johnston</option>
<option>Vasul</option></select>
<br><br>
<input type=Submit name=\"Submit\" value=\"Submit\">");
}
if ($Visitnum == 3)
{
$Visitnm = 3;
$Username = $first . " " . $second;
print ("<form action=\"join.php\" method=POST>
Please enter your desired password:<br>
<input type=text name=\"Password\">
<br><br>
<input type=Submit name=\"Submit\" value=\"Submit\">");
}
if ($Visitnum == 4)
{
$Visitnm = 4;
print ("<form action=\"join.php\" method=POST>
Now choose the country of your allegiance:<br>
<select name=\"Country\" value=\"Country\">
<option>None</option>
<option>Vatican</option>
<option>England</option>
<option>France</option>
<option>Italy</option>
<option>Germany</option>
<option>Spain</option>
<option>Netherlands</option>
<option>Scotland</option>
<option>Scandinavia</option>
<option>Byzantine Empire</option></select>
<br><br>
<input type=Submit name=\"Submit\" value=\"Submit\">");
}
if ($Visitnum == 5)
{
$Visitnm = 5;
print ("Please enter your email adress:<br>
<input type=text name=\"Email\">
<input type=Submit name=\"Submit\" value=\"Submit\">");
}
if ($Visitnum == 6)
{
$Query = "INSERT into users values ('0', '$Username','$Password', '$Email', '$Country', '$Rank', '$Money', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')";
if (mysql_query($Query))
{
$Money = "1000";
$Rank = "Peasant";
$Query2 = "SELECT Wheat, oat, Rice, Corn, Stone, Clay, Iron, Marble, Pottery, Blacksmith, Cloth, Mill, Min, Carpenters, Apartment, House, Palace from users where Username='$Username'";
$Result = mysql_query($Query2);
while ($Row = mysql_fetch_array($Result))
{
$Holdings = $Row[Wheat] . " Wheat Farm<br>" . $Row[oat] . " Oat Farm<br>" . $Row[Rice] . " Rice Farm<br>" . $Row[Corn] . " Corn Farm<br>" . $Row[Stone] . "Stone Mine<br>, " . $Row[Clay] . " Clay Mine<br>" . $Row[Iron] . " Iron Mine<br>" . $Row[Marble] . " Marble Mine<br>" . $Row[Pottery] . " Pottery Shop<br>" . $Row[Blacksmith] . " Blacksmith Shop<br>" . $Row[Cloth] . " Cloth Shop<br>" . $Row[Mill] . " Mill Shop<br>" . $Row[Min] . " Mint Shop<br>" . $Row[Carpenters] . " Carpenter Shop<br>" . $Row[Apartment] . " Apartment<br>" . $Row[House] . " House<br>" . $Row[Palace] . " Palace<br>";
}
session_register('Country');
session_register('Username');
session_register('Money');
session_register('Rank');
session_register('Holdings');
session_register('Logged');
print ("You are now registered. Click <a href=\"index.php\">here</a> to proceed.");
}
}
?>