create a new account through web site interface
Posted: Fri Nov 03, 2017 6:26 pm
Hi folks
I have tried to customize a sign up form for connecting my site interface to the Maven, but it seems something is wrong, so its not working. If you click on the submit button the page will refresh and all of the fields will be empty.
would you please look at the code an tell me which part is wrong?
P.S: Api.php has been created before
I have tried to customize a sign up form for connecting my site interface to the Maven, but it seems something is wrong, so its not working. If you click on the submit button the page will refresh and all of the fields will be empty.
would you please look at the code an tell me which part is wrong?
P.S: Api.php has been created before
Code: Select all
<!DOCTYPE html>
<html >
<html>
<title>Sign-Up/Login Form</title>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body background="pic01.jpg">
<?php
$avatarurl = "http://xxx.xxx.xxx.xxx:8087/Image?Name=Avatars"; // set your url here
$avatarmax = 64; // number of avatars available
$avatarsize = 32; // use 32 in version 5, 48 in version 4
include "API.php";
if (isset($_REQUEST["Submit"]))
{
$Player = $_REQUEST["Player"];
$RealName = $_REQUEST["RealName"];
$Gender = $_REQUEST["Gender"];
$Location = $_REQUEST["Location"];
$Password1 = $_REQUEST["Password1"];
$Password2 = $_REQUEST["Password2"];
$Email = $_REQUEST["Email"];
$Avatar = $_REQUEST["Avatar"];
if ($Password1 <> $Password2) die("Password mismatch. Click Back Button to correct.");
$params = array("Command" => "AccountsAdd",
"Player" => $Player,
"RealName" => $RealName,
"PW" => $Password1,
"Location" => $Location,
"Email" => $Email,
"Avatar" => $Avatar,
"Gender" => $Gender,
"Chat" => "Yes",
"Note" => "Account created via API");
$api = Poker_API($params);
if ($api -> Result == "Ok") echo "Account successfully created for $Player";
else echo "Error: " . $api -> Error . "<br>Click Back Button to correct.";
exit;
}
?>
<div class="form">
<ul class="tab-group">
<li class="tab active"><a href="#signup">sign up</a></li>
<li class="tab"><a href="#login">login</a></li>
</ul>
<div class="tab-content">
<div id="signup">
<form method="post">
<div class="top-row">
<div class="field-wrap">
<label>
Player Name<span class="req">*</span>
</label>
<input type="text" name="Player" required autocomplete="off" />
</div>
<div class="field-wrap">
<label>
Real Name<span class="req">*</span>
</label>
<input type="text" name="RealName" required autocomplete="off" />
</div>
<div class="field-wrap">
<label>
Location <span class="req">*</span>
</label>
<input type="text" name="Location" required autocomplete="off"/>
</div>
</div>
<div class="field-wrap">
<label>
Email Address<span class="req">*</span>
</label>
<input type="text" name="Email" required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Set A Password<span class="req">*</span>
</label>
<input type="password" name="Password1" required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Confirm Password<span class="req">*</span>
</label>
<input type="password" name="Password2" required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Your Gender<span class="req">*</span>
</label>
<br>
<br>
<span style="color:#a0b3b0">
<input type="radio" name="Gender" Value="Male" checked>Male
<input type="radio" name="Gender" Value="Female">Female
</span>
</div>
<br>
<div class="field-wrap">
<label>
Your avatar:
</label>
</div>
<br>
<div style="width: 400x; height: 175px; overflow: auto; border: solid 1px">
<?php
for ($i = 0; $i < $avatarmax; $i++)
{
$a = "display: row; width: " . $avatarsize . "px; height: " . $avatarsize . "px; background: " .
"url('" . $avatarurl . "') no-repeat -" . ($i * $avatarsize) . "px 0px;";
$s = "<input type='radio' name='Avatar' value='" . ($i + 1) . "'";
if ($i == 0) $s .= " checked";
$s .= ">";
$s .= "<div style=\"" . $a . "\"></div>";
echo $s . "<br><br>\r\n";
}
?>
</td></tr>
</div>
<button type="submit" class="button button-block"/>Get Started</button>
</form>
</div>
<div id="login">
<h1>welcome</h1>
<form method="post" action="http://150.107.0.39:8087/">
<div class="field-wrap">
<label>
Player Name<span class="req">*</span>
</label>
<input type="text" name="LoginName"required autocomplete="off"/>
</div>
<div class="field-wrap">
<label>
Password<span class="req">*</span>
</label>
<input type="password" name="LoginPassword" required autocomplete="off"/>
</div>
<p class="forgot"><a href="#">forget password </a></p>
<button class="button button-block"/>Log In </button>
</form>
</div>
</div><!-- tab-content -->
<!-- /form -->
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>