|
-
Mar 30th, 2004, 03:25 PM
#1
Thread Starter
Frenzied Member
If Statements [RESOLVED]
This script allows me to add a member to my site and checks the passwords match, I also want to make sure the username is not already registered, does anyone know a easy way to add this?
Code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Author" content="">
<title>Supporters Website - <a href="http://" target="_blank">http://</a></title>
<link rel="stylesheet" type="text/css" href="includes/nz.css">
<style type="text/css">
<!--
A:link, A:visited { text-decoration: none }
A:hover { COLOR: black; text-decoration: underline }
A.B:link, A.B:visited { COLOR: #000000; text-decoration: none }
A.B:hover { COLOR: black; text-decoration: underline }
-->
</style>
</head>
<body link="#000000" vlink="#000000">
<?php
require("includes/header.php");
?>
<table BORDER="0" CELLPADDING="3" CELLSPACING="0" width="100%">
<tr>
<td valign="top" width="120" bgcolor="#e2e2e2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" valign="top" bgcolor="#FFFFFF">
<?php
require("includes/menu.php");
?>
</td>
<td class="td-whitecell" width="100%" valign="top">
<table width='100%' border='0' cellpadding='1' cellspacing='0' bgcolor='#ffffff'>
<tr>
<td width='100%' class="td-greyborder">
<table width='100%' class="td-whitecell" cellpadding='4' cellspacing='0' border='0'>
<tr>
<td align='left' width='100%'>
<table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td class="td-dogscell"><font class="boxtitle">..:: <span lang="en-au">
MEMBERS SIGN-UP</span> ::..</font></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF">
<font class="maintext">
<?php
mysql_connect (localhost, user, password);
mysql_select_db (nz);
if ($_POST['action'] == 'save') {
if($_POST['user_password'] == $_POST
['user_password_confirm']){
$result = mysql_query ("INSERT INTO DB_Warriors_Users Values('','$user_name','$user_email','$user_password','$user_pending_flag','$user_suspended_flag','$
user_moderator_flag','$user_admin_flag','$register_code','$user_real_name','$location','$age','$sex','$season_tkt_no')");
echo "Passwords match.\n";
} else {
echo "Your passwords do not match.\n";
}
} else {
?>
<p>
</font>
<font face="Verdana"
size="1">
<form method="POST" action="signup.php">
<input type="hidden" name="action" value="save" />
<p>
<font face="Verdana" size="1" color="#00000">Username:<br><input type="text" name="user_name" size="40" style="border-style: solid; border-width: 1"></font> <br>
<font face="Verdana" size="1" color="#00000">Email:<br>
<input type="text" name="user_email" size="40" style="border-style: solid; border-width: 1"></font> <br>
<font face="Verdana" size="1" color="#00000">Password:<br> <input type="password" name="user_password" size="40" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Confirm Password:<br> <input type="password" name="user_password_confirm" size="40" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Name:<br> <input type="text" name="user_real_name" size="40" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Location:<br> <input type="text" name="location" size="40" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Age:<br> <input type="text" name="age" size="5" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Season Ticket Number: <br><input type="text" name="season_tkt_no " size="40" style="border-style: solid; border-width: 1"></font><br>
<font face="Verdana" size="1" color="#00000">Sex:<br></strong></font><font face="Verdana" size="3"><select name="sex">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select></font><font face="Verdana" size="2">
<br><br>
<input type="submit" value="Register" name="B1"></p>
</form>
<?php
}
?>
</font>
</td>
</tr>
</table>
</font>
</td></tr></table>
</td></tr></table>
<br>
</td>
</tr>
</table>
</table>
<?php
require("includes/footer.php");
?>
</body>
</html>
Last edited by kiwis; Apr 3rd, 2004 at 11:47 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|