Hey,
Thanks for your reply, but after taking that in mind it does not seem to work either..
Sorry for all the code but i think its better if i send what i have so you can have a look at it...
Code: Select all
<div class="welcome">
<p>registration</p>
</div>
<?php
// Connects to Database
$dbc = mysql_connect ('db.sonassi.com','c2_listen','listen256') OR die('Could not connect to MySQL : ' . mysql_error() );
mysql_select_db ('c2_listen') OR die('Could not select the database : ' . mysql_error() );
//This code runs if the form has been submitted
if (isset($_POST['submitted']))
{
//This makes sure they did not leave any fields blank
if (!trim($_POST['txt_fname']) || !trim($_POST['txt_sname']) || !trim($_POST['txt_address'])
|| !trim($_POST['txt_city']) || !trim($_POST['txt_county']) || !trim($_POST['txt_pcode'])
|| !trim($_POST['txt_email']) || !trim($_POST['txt_username']))
{
echo '<p style=margin-left:5px;font-size:12px><img src=images/warning_48.png> You did not complete all of the required fields.</p>';
}
else
{
if (!get_magic_quotes_gpc()) {
$_POST['txt_username'] = addslashes($_POST['txt_username']);
}
$usercheck = $_POST['txt_username'];
$check = mysql_query("SELECT username FROM members WHERE username = '$usercheck'") or die(mysql_error());
$check2 = mysql_num_rows($check);
if ($check2 != 0) {
echo '<p style=margin-left:5px;>Sorry, the username <b>'.$_POST['txt_username'].'</b> is already in use. </p>';
}
$insert = "INSERT INTO members (title, fname, sname, address, city_town, county, postcode, constituency, email, username) VALUES
(
'MRRRR',
'".$_POST['txt_fname']."',
'".$_POST['txt_sname']."',
'".$_POST['txt_address']."',
'".$_POST['txt_city']."',
'".$_POST['txt_county']."',
'".$_POST['txt_pcode']."',
'TEST',
'".$_POST['txt_email']."',
'".$_POST['txt_username']."'
)";
$add_member = mysql_query($insert);
}
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="registers">
<div style="background-image:url('images/register.jpg'); background-repeat: no-repeat; margin-left:5px;height:250px">
<table style="font-size:12px; margin-left:10px;">
<tr><td style="width:630px">Bills are the very essence of government.<br/>
Bills, if passed, become the laws by which we are all governed. Drafting and voting on Bills about <br/>
tax rates, speed limits, immigration, minimum wage, abortion, social housing policy etc., is the core <br/>
function of each elected government and your MP votes on your behalf on all these matters. This <br/>
web site is designed to try to give you, the voter, a chance to influence these Bills, <br/>
via your MP, in a way which has not previously been possible.
</td></tr>
</table>
<table style="font-size:12px; margin-left:10px; margin-top:5px">
<tr><td style="width:230px">Title</td><td>
<select name="title">
<option value="">-select-</option>
<option value="/tags/">Mr</option>
<option value="/">Mrs</option>
<option value="">Ms</option>
<option value="">Miss</option>
</select>
*</td></tr>
<tr><td style="width:230px"></td><td>
if other, please enter: <br/><input type="text" name="txt_title2" style="width:165px"/></td></tr>
<tr><td><input id="hidden" type="hidden"/> </td></tr>
<tr><td style="width:230px">First name</td><td>
<input type="text" name="txt_fname" style="width:165px"/>*</td></tr>
<tr><td style="width:230px">Last name</td><td>
<input type="text" name="txt_sname" style="width:165px"/>*</td></tr>
</table>
</div>
<br/>
<table style="font-size:12px; margin-left:14px;">
<tr><td style="width:230px">Address</td><td>
<input type="text" name="txt_address" style="width:165px"/>*</td></tr>
<tr><td style="width:230px"></td><td>
<input type="text" name="txt_address2" style="width:165px"/></td></tr>
<tr><td style="width:230px">City/Town</td><td>
<input type="text" name="txt_city" style="width:165px"/>*</td></tr>
<tr><td style="width:230px">County</td><td>
<input type="text" name="txt_county" style="width:165px"/>*</td></tr>
<tr><td style="width:230px">Post code</td><td>
<input type="text" name="txt_pcode" style="width:165px"/>*</td></tr>
</table>
<table style="font-size:12px; margin-left:14px;">
<tr><td style="width:230px">Constituency</td><td>
<select name="sel_const" style="width:226px">
<option value="">Bury North</option>
<option value="">Cheadle</option>
<option value="">Prestwich</option>
<option value="">Salford</option>
<option value="">Tatton</option>
</select>
*</td></tr>
<tr><td style="width:230px">Email address</td><td>
<input type="text" name="txt_email0" style="width:165px"/>* This will be used as part of your login</td></tr>
<tr><td style="width:230px">Username</td><td>
<input type="text" name="txt_username0" style="width:165px"/>* This will be used as part of your login</td></tr>
<tr><td></td><td align="right">
<input name="submitted" type="image" src="images/submit.jpg" value="Submit" alt="Submit"/></td></tr>
</table>
</form>
</div>
I would appreciate it if anybody can help..
Thanks
Regards
Billy