Problems with PHP/MySQL database

I think i have included all relavant PHP files below and the SQL database is already intact so should be fine…please see if any errors in coding and why email activation link would return a fail and that data would not be sent to SQL database

template_open_account.php

<link href="templates_stylesheets/style_default_main.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
    </style>
	<table width="767" cellpadding="0" cellspacing="0" border="0">
		<tr valign="top">
			<!-- LEFT TRAIL ELEMENTS -->

			<td width="136" style="padding-left:7px;padding-top:8px;">
	
				<span class="regTrail blackHeadersmall"><img src="templates/templates_images/registration_images/registration_1_blue.gif"/>my details</span>
				<span class="regTrail"><img src="templates/templates_images/registration_images/registration_2_grey.gif"/>activation</span>
				<span class="regTrail"><img src="templates/templates_images/registration_images/registration_3_grey.gif"/>deposit</span>
	
			</td>
		<!-- MAIN BODY -->

		  <td style="padding-top:8px;">
				<h1>Open Account</h1>
				<form name="reg_your_details" method="post" action="includes/do_open_account.php">
					<!-- This section is dynamic as per site id -->
<siteid100/>
<p>Opening an account is straightforward and should only take a few minutes. Please complete all parts of the form. We recommend that you read our
	<a href="index.php?page=terms_and_conditions" target="_blank">terms and conditions</a> which explain how <?  echo $casinoname; ?> treats information that we collect from you.</p>
<? if ($error!=""){
echo "<p class=\\"style1\\">$error</p>";
} ?>

<table cellspacing="0" cellpadding="0" border="0" width="633">
						<tr>
							<td class="whiteHeader BlueTableHeader">
								Your details
							</td>
						</tr>
				  </table>

					<table cellspacing="0" cellpadding="0" border="0" class="openAccTable" style="width:633;">
						<tr><td height="5" colspan="3"></td></tr>
					<!-- Existing telephone customer only applies to vc.co.uk and vc.com sites -->					
											
						<tr>
							<td colspan="3">
								<p class="bold">Please fill out your personal and account details below: </p>							</td>
						</tr>
						<tr><td height="10" colspan="3"></td></tr>
																		
						<tr>
							<td valign="top" class="bold" width="150">Your username:</td>
							<td valign="top"><input name="uid" type="text" class="normal" id="uid" style="width:180px;" value="<?php  echo "$uid"; ?>" maxlength="12" error="Please enter your user name"/></td>
							<td class="smallGrey" valign="top">
								This will be your new online username. It must be between 6 and 12 letters or numbers and must start with a letter. Example JohnDoe54							</td>
						</tr>
						<tr>
							<td class="bold">Password:</td>
							<td><input name="pass1" type="password" class="normal" id="pass1" style="width:180px;" value="<?php echo "$password"; ?>" error="Please enter a password" errorspaces="Please do not use spaces in your password"/></td>
						</tr>
						<tr>
							<td class="bold">Re-type password:</td>
							<td><input name="pass2" type="password" class="normal" id="pass2" style="width:180px;" value="<?php echo "$password"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>
							<td></td>
						</tr>
						<tr>
							<td class="bold">Your email address:</td>
							<td><input name="email" type="text" class="normal" id="email" style="width:180px;" value="<?php  echo "$email"; ?>" error="Please enter a valid email address"/></td>
							<td class="smallGrey">Example : yourname@email.com</td>
						</tr>		
						<tr>
						<td colspan="3" style="padding-top:5px;padding-bottom:5px;">
								Note: We will send a confirmation message to the email address you enter above						  </td>
						</tr>
						<tr>
						  <td colspan="3">
							<input id="emailupdates1" name="emailupdates1" type="checkbox" value="1" checked />
							  I would like to receive details of free bets, special offers and other  products and promotions.</td>
						</tr>
						<tr>
						  <td colspan="3">&nbsp;</td>
					  </tr>
					  <tr>
							<td class="bold">Gender:</td>
							<td><table cellspacing="0" cellpadding="0">
							  <TR>
                                <TD>Male</TD>
							    <TD><INPUT type="radio" value="M" name="gender"></TD>
							    <TD>&nbsp;Female</TD>
							    <TD><INPUT type="radio" value="F" name="gender"></TD>
							    <TD>*</TD>
						      </TR>
							  </table>							</td>
							<td></td>
					  </tr>
						<tr>
							<td class="bold">First Name: </td>
							<td><input name="firstname" type="text" class="normal" id="firstname" style="width:180px;" value="<?php  echo "$firstname"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>
							<td></td>
						</tr>
						<tr>
							<td class="bold">Last Name: </td>
							<td><input name="lastname" type="text" class="normal" id="lastname" style="width:180px;" value="<?php  echo "$lastname"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>
							<td></td>
						</tr>
						<tr>
							<td class="bold">Date of Birth: </td>
							<td><select id="doby" name="doby">
                              <option value="<?php echo "$doby"; ?>"><?php echo "$doby"; ?></option>
                              <option value="1989">1989</option>
                              <option value="1988">1988</option>
                              <option value="1987">1987</option>
                              <option value="1986">1986</option>
                              <option value="1985">1985</option>
                              <option value="1984">1984</option>
                              <option value="1983">1983</option>
                              <option value="1982">1982</option>
                              <option value="1981">1981</option>
                              <option value="1980">1980</option>
                              <option value="1979">1979</option>
                              <option value="1978">1978</option>
                              <option value="1977">1977</option>
                              <option value="1976">1976</option>
                              <option value="1975">1975</option>

                              <option value="1974">1974</option>

                              <option value="1973">1973</option>

                              <option value="1972">1972</option>

                              <option value="1971">1971</option>

                              <option value="1970">1970</option>

                              <option value="1969">1969</option>

                              <option value="1968">1968</option>

                              <option value="1967">1967</option>

                              <option value="1966">1966</option>

                              <option value="1965">1965</option>

                              <option value="1964">1964</option>

                              <option value="1963">1963</option>

                              <option value="1962">1962</option>

                              <option value="1961">1961</option>

                              <option value="1960">1960</option>

                              <option value="1959">1959</option>

                              <option value="1958">1958</option>

                              <option value="1957">1957</option>

                              <option value="1956">1956</option>

                              <option value="1955">1955</option>

                              <option value="1954">1954</option>

                              <option value="1953">1953</option>

                              <option value="1952">1952</option>

                              <option value="1951">1951</option>

                              <option value="1950">1950</option>

                              <option value="1949">1949</option>

                              <option value="1948">1948</option>

                              <option value="1947">1947</option>

                              <option value="1946">1946</option>

                              <option value="1945">1945</option>

                              <option value="1944">1944</option>

                              <option value="1943">1943</option>

                              <option value="1942">1942</option>

                              <option value="1941">1941</option>

                              <option value="1940">1940</option>

                              <option value="1939">1939</option>

                              <option value="1938">1938</option>

                              <option value="1937">1937</option>

                              <option value="1936">1936</option>

                              <option value="1935">1935</option>

                              <option value="1934">1934</option>

                              <option value="1933">1933</option>

                              <option value="1932">1932</option>

                              <option value="1931">1931</option>

                              <option value="1930">1930</option>

                              <option value="1929">1929</option>

                              <option value="1928">1928</option>

                              <option value="1927">1927</option>

                              <option value="1926">1926</option>

                              <option value="1925">1925</option>

                              <option value="1924">1924</option>

                              <option value="1923">1923</option>

                              <option value="1922">1922</option>

                              <option value="1921">1921</option>

                              <option value="1920">1920</option>

                              <option value="1919">1919</option>

                              <option value="1918">1918</option>

                              <option value="1917">1917</option>

                              <option value="1916">1916</option>

                              <option value="1915">1915</option>

                              <option value="1914">1914</option>

                              <option value="1913">1913</option>

                              <option value="1912">1912</option>

                              <option value="1911">1911</option>

                              <option value="1910">1910</option>

                              <option value="1909">1909</option>

                              <option value="1908">1908</option>

							  </select>

                              <select id="dobm" name="dobm">

                                <option value="<?php echo "$dobm"; ?>"><?php echo "$dobm"; ?></option>

                                <option value="01">Jan</option>

                                <option value="02">Feb</option>

                                <option value="03">Mar</option>

                                <option value="04">Apr</option>

                                <option value="05">May</option>

                                <option value="06">Jun</option>

                                <option value="07">Jul</option>

                                <option value="08">Aug</option>

                                <option value="09">Sep</option>

                                <option value="10">Oct</option>

                                <option value="11">Nov</option>

                                <option value="12">Dec</option>

                              </select>

                              <select id="dobd" name="dobd">

                                <option value="<?php echo "$dobd"; ?>"><?php echo "$dobd"; ?></option>

                                <option value="01">01</option>

                                <option value="02">02</option>

                                <option value="03">03</option>

                                <option value="04">04</option>

                                <option value="05">05</option>

                                <option value="06">06</option>

                                <option value="07">07</option>

                                <option value="08">08</option>

                                <option value="09">09</option>

                                <option value="10">10</option>

                                <option value="11">11</option>

                                <option value="12">12</option>

                                <option value="13">13</option>

                                <option value="14">14</option>

                                <option value="15">15</option>

                                <option value="16">16</option>

                                <option value="17">17</option>

                                <option value="18">18</option>

                                <option value="19">19</option>

                                <option value="20">20</option>

                                <option value="21">21</option>

                                <option value="22">22</option>

                                <option value="23">23</option>

                                <option value="24">24</option>

                                <option value="25">25</option>

                                <option value="26">26</option>

                                <option value="27">27</option>

                                <option value="28">28</option>

                                <option value="29">29</option>

                                <option value="30">30</option>

                                <option value="31">31</option>

                              </select></td>

							<td></td>

						</tr>

						

						<tr>

							<td class="bold">Address:</td>

							<td><input name="street" type="text" class="normal" id="street" style="width:180px;" value="<?php  echo "$street"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>

							<td></td>

						</tr>

						<tr>

							<td class="bold">ZIP/Post Code :</td>

							<td><input name="zip" type="text" class="normal" id="zip" style="width:180px;" value="<?php  echo "$zip"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>

							<td></td>

						</tr>

						<tr>

							<td class="bold">City:</td>

							<td><input name="city" type="text" class="normal" id="city" style="width:180px;" value="<?php  echo "$city"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>

							<td></td>

						</tr>

						<tr>

							<td class="bold">Country:</td>

							<td><select name="country">

                                      <option value="0">Please choose a country</option>

                                      <option value="se" <?php if($country=="se"){

echo "selected=\\"selected\\"";



} ?>>Sweden</option>

                                      <option value="fr" <?php if($country=="fr"){

echo "selected=\\"selected\\"";



} ?>>France</option>

                                      <option value="no" <?php if($country=="no"){

echo "selected=\\"selected\\"";



} ?>>Norway</option>

                                      <option value="dk" <?php if($country=="dk"){

echo "selected=\\"selected\\"";



} ?>>Denmark</option>

                                      <option value="it" <?php if($country=="it"){

echo "selected=\\"selected\\"";



} ?>>Italy</option>

                                      <option value="de" <?php if($country=="de"){

echo "selected=\\"selected\\"";



} ?>>Germany</option>

                                      <option value="fi" <?php if($country=="fi"){

echo "selected=\\"selected\\"";



} ?>>Finland</option>

                                      <option value="pl" <?php if($country=="pl"){

echo "selected=\\"selected\\"";



} ?>>Poland</option>

                                      <option value="nl" <?php if($country=="nl"){

echo "selected=\\"selected\\"";



} ?>>Netherlands</option>

                                      <option value="be" <?php if($country=="be"){

echo "selected=\\"selected\\"";



} ?>>Belgium</option>

                                      <option value="af" <?php if($country=="af"){

echo "selected=\\"selected\\"";



} ?>>Afghanistan</option>

                                      <option value="al" <?php if($country=="al"){

echo "selected=\\"selected\\"";



} ?>>Albania</option>

                                      <option value="dz" <?php if($country=="dz"){

echo "selected=\\"selected\\"";



} ?>>Algeria</option>

                                      <option value="ad" <?php if($country=="ad"){

echo "selected=\\"selected\\"";



} ?>>Andorra</option>

                                      <option value="ao" <?php if($country=="ao"){

echo "selected=\\"selected\\"";



} ?>>Angola</option>

                                      <option value="ai" <?php if($country=="ai"){

echo "selected=\\"selected\\"";



} ?>>Anguilla</option>

                                      <option value="aq" <?php if($country=="aq"){

echo "selected=\\"selected\\"";



} ?>>Antarctica</option>

                                      <option value="ag" <?php if($country=="ag"){

echo "selected=\\"selected\\"";



} ?>>Antigua and Barbuda</option>

                                      <option value="ar" <?php if($country=="ar"){

echo "selected=\\"selected\\"";



} ?>>Argentina</option>

                                      <option value="am" <?php if($country=="am"){

echo "selected=\\"selected\\"";



} ?>>Armenia</option>

                                      <option value="aw" <?php if($country=="aw"){

echo "selected=\\"selected\\"";



} ?>>Aruba</option>

                                      <option value="au" <?php if($country=="au"){

echo "selected=\\"selected\\"";



} ?>>Australia</option>

                                      <option value="at" <?php if($country=="at"){

echo "selected=\\"selected\\"";



} ?>>Austria</option>

                                      <option value="az" <?php if($country=="az"){

echo "selected=\\"selected\\"";



} ?>>Azerbaidjan</option>

                                      <option value="bs" <?php if($country=="bs"){

echo "selected=\\"selected\\"";



} ?>>Bahamas</option>

                                      <option value="bh" <?php if($country=="bh"){

echo "selected=\\"selected\\"";



} ?>>Bahrain</option>

                                      <option value="bd" <?php if($country=="bd"){

echo "selected=\\"selected\\"";



} ?>>Bangladesh</option>

                                      <option value="bb" <?php if($country=="bb"){

echo "selected=\\"selected\\"";



} ?>>Barbados</option>

                                      <option value="by" <?php if($country=="by"){

echo "selected=\\"selected\\"";



} ?>>Belarus</option>

                                      <option value="bz" <?php if($country=="bz"){

echo "selected=\\"selected\\"";



} ?>>Belize</option>

                                      <option value="bj" <?php if($country=="bj"){

echo "selected=\\"selected\\"";



} ?>>Benin</option>

                                      <option value="bm" <?php if($country=="bm"){

echo "selected=\\"selected\\"";



} ?>>Bermuda</option>

                                      <option value="bt" <?php if($country=="bt"){

echo "selected=\\"selected\\"";



} ?>>Bhutan</option>

                                      <option value="bo" <?php if($country=="bo"){

echo "selected=\\"selected\\"";



} ?>>Bolivia</option>

                                      <option value="ba" <?php if($country=="ba"){

echo "selected=\\"selected\\"";



} ?>>Bosnia-Herzegovina</option>

                                      <option value="bw" <?php if($country=="bw"){

echo "selected=\\"selected\\"";



} ?>>Botswana</option>

                                      <option value="bv" <?php if($country=="bv"){

echo "selected=\\"selected\\"";



} ?>>Bouvet Island</option>

                                      <option value="br" <?php if($country=="br"){

echo "selected=\\"selected\\"";



} ?>>Brazil</option>

                                      <option value="io" <?php if($country=="io"){

echo "selected=\\"selected\\"";



} ?>>British Indian Ocean Territory</option>

                                      <option value="bn" <?php if($country=="bn"){

echo "selected=\\"selected\\"";



} ?>>Brunei Darussalam</option>

                                      <option value="bg" <?php if($country=="bg"){

echo "selected=\\"selected\\"";



} ?>>Bulgaria</option>

                                      <option value="bf" <?php if($country=="bf"){

echo "selected=\\"selected\\"";



} ?>>Burkina Faso</option>

                                      <option value="bi" <?php if($country=="bi"){

echo "selected=\\"selected\\"";



} ?>>Burundi</option>

                                      <option value="kh" <?php if($country=="kh"){

echo "selected=\\"selected\\"";



} ?>>Cambodia, Kingdom of</option>

                                      <option value="cm" <?php if($country=="cm"){

echo "selected=\\"selected\\"";



} ?>>Cameroon</option>

                                      <option value="ca" <?php if($country=="ca"){

echo "selected=\\"selected\\"";



} ?>>Canada</option>

                                      <option value="cv" <?php if($country=="cv"){

echo "selected=\\"selected\\"";



} ?>>Cape Verde</option>

                                      <option value="ky" <?php if($country=="ky"){

echo "selected=\\"selected\\"";



} ?>>Cayman Islands</option>

                                      <option value="cf" <?php if($country=="cf"){

echo "selected=\\"selected\\"";



} ?>>Central African Republic</option>

                                      <option value="td" <?php if($country=="td"){

echo "selected=\\"selected\\"";



} ?>>Chad</option>

                                      <option value="cl" <?php if($country=="cl"){

echo "selected=\\"selected\\"";



} ?>>Chile</option>

                                      <option value="cn" <?php if($country=="cn"){

echo "selected=\\"selected\\"";



} ?>>China</option>

                                      <option value="cx" <?php if($country=="cx"){

echo "selected=\\"selected\\"";



} ?>>Christmas Island</option>

                                      <option value="cc" <?php if($country=="cc"){

echo "selected=\\"selected\\"";



} ?>>Cocos (Keeling) Islands</option>

                                      <option value="co" <?php if($country=="co"){

echo "selected=\\"selected\\"";



} ?>>Colombia</option>

                                      <option value="km" <?php if($country=="km"){

echo "selected=\\"selected\\"";



} ?>>Comoros</option>

                                      <option value="cg" <?php if($country=="cg"){

echo "selected=\\"selected\\"";



} ?>>Congo</option>

                                      <option value="cd" <?php if($country=="cd"){

echo "selected=\\"selected\\"";



} ?>>Congo, The Democratic Republic of the</option>

                                      <option value="ck" <?php if($country=="ck"){

echo "selected=\\"selected\\"";



} ?>>Cook Islands</option>

                                      <option value="cr" <?php if($country=="cr"){

echo "selected=\\"selected\\"";



} ?>>Costa Rica</option>

                                      <option value="hr" <?php if($country=="hr"){

echo "selected=\\"selected\\"";



} ?>>Croatia</option>

                                      <option value="cu" <?php if($country=="cu"){

echo "selected=\\"selected\\"";



} ?>>Cuba</option>

                                      <option value="cy" <?php if($country=="cy"){

echo "selected=\\"selected\\"";



} ?>>Cyprus</option>

                                      <option value="cz" <?php if($country=="cz"){

echo "selected=\\"selected\\"";



} ?>>Czech Republic</option>

                                      <option value="dj" <?php if($country=="dj"){

echo "selected=\\"selected\\"";



} ?>>Djibouti</option>

                                      <option value="dm" <?php if($country=="dm"){

echo "selected=\\"selected\\"";



} ?>>Dominica</option>

                                      <option value="do" <?php if($country=="do"){

echo "selected=\\"selected\\"";



} ?>>Dominican Republic</option>

                                      <option value="tp" <?php if($country=="tp"){

echo "selected=\\"selected\\"";



} ?>>East Timor</option>

                                      <option value="ec" <?php if($country=="ec"){

echo "selected=\\"selected\\"";



} ?>>Ecuador</option>

                                      <option value="eg" <?php if($country=="eg"){

echo "selected=\\"selected\\"";



} ?>>Egypt</option>

                                      <option value="sv" <?php if($country=="sv"){

echo "selected=\\"selected\\"";



} ?>>El Salvador</option>

                                      <option value="gq" <?php if($country=="gq"){

echo "selected=\\"selected\\"";



} ?>>Equatorial Guinea</option>

                                      <option value="er" <?php if($country=="er"){

echo "selected=\\"selected\\"";



} ?>>Eritrea</option>

                                      <option value="ee" <?php if($country=="ee"){

echo "selected=\\"selected\\"";



} ?>>Estonia</option>

                                      <option value="et" <?php if($country=="et"){

echo "selected=\\"selected\\"";



} ?>>Ethiopia</option>

                                      <option value="fk" <?php if($country=="fk"){

echo "selected=\\"selected\\"";



} ?>>Falkland Islands</option>

                                      <option value="fo" <?php if($country=="fo"){

echo "selected=\\"selected\\"";



} ?>>Faroe Islands</option>

                                      <option value="fj" <?php if($country=="fj"){

echo "selected=\\"selected\\"";



} ?>>Fiji</option>

                                      <option value="gf" <?php if($country=="gf"){

echo "selected=\\"selected\\"";



} ?>>French Guyana</option>

                                      <option value="tf" <?php if($country=="tf"){

echo "selected=\\"selected\\"";



} ?>>French Southern Territories</option>

                                      <option value="ga" <?php if($country=="ga"){

echo "selected=\\"selected\\"";



} ?>>Gabon</option>

                                      <option value="gm" <?php if($country=="gm"){

echo "selected=\\"selected\\"";



} ?>>Gambia</option>

                                      <option value="ge" <?php if($country=="ge"){

echo "selected=\\"selected\\"";



} ?>>Georgia</option>

                                      <option value="gh" <?php if($country=="gh"){

echo "selected=\\"selected\\"";



} ?>>Ghana</option>

                                      <option value="gi" <?php if($country=="gi"){

echo "selected=\\"selected\\"";



} ?>>Gibraltar</option>

                                      <option value="gr" <?php if($country=="gr"){

echo "selected=\\"selected\\"";



} ?>>Greece</option>

                                      <option value="gl" <?php if($country=="gl"){

echo "selected=\\"selected\\"";



} ?>>Greenland</option>

                                      <option value="gd" <?php if($country=="gd"){

echo "selected=\\"selected\\"";



} ?>>Grenada</option>

                                      <option value="gp" <?php if($country=="gp"){

echo "selected=\\"selected\\"";



} ?>>Guadeloupe (French)</option>

                                      <option value="gt" <?php if($country=="gt"){

echo "selected=\\"selected\\"";



} ?>>Guatemala</option>

                                      <option value="gn" <?php if($country=="gn"){

echo "selected=\\"selected\\"";



} ?>>Guinea</option>

                                      <option value="gw" <?php if($country=="gw"){

echo "selected=\\"selected\\"";



} ?>>Guinea Bissau</option>

                                      <option value="gy" <?php if($country=="gy"){

echo "selected=\\"selected\\"";



} ?>>Guyana</option>

                                      <option value="ht" <?php if($country=="ht"){

echo "selected=\\"selected\\"";



} ?>>Haiti</option>

                                      <option value="hm" <?php if($country=="hm"){

echo "selected=\\"selected\\"";



} ?>>Heard and McDonald Islands</option>

                                      <option value="va" <?php if($country=="va"){

echo "selected=\\"selected\\"";



} ?>>Holy See (Vatican City State)</option>

                                      <option value="hn" <?php if($country=="hn"){

echo "selected=\\"selected\\"";



} ?>>Honduras</option>

                                      <option value="hk" <?php if($country=="hk"){

echo "selected=\\"selected\\"";



} ?>>Hong Kong</option>

                                      <option value="hu" <?php if($country=="hu"){

echo "selected=\\"selected\\"";



} ?>>Hungary</option>

                                      <option value="is" <?php if($country=="is"){

echo "selected=\\"selected\\"";



} ?>>Iceland</option>

                                      <option value="in" <?php if($country=="in"){

echo "selected=\\"selected\\"";



} ?>>India</option>

                                      <option value="id" <?php if($country=="id"){

echo "selected=\\"selected\\"";



} ?>>Indonesia</option>

                                      <option value="ir" <?php if($country=="ir"){

echo "selected=\\"selected\\"";



} ?>>Iran</option>

                                      <option value="iq" <?php if($country=="iq"){

echo "selected=\\"selected\\"";



} ?>>Iraq</option>

                                      <option value="ie" <?php if($country=="ie"){

echo "selected=\\"selected\\"";



} ?>>Ireland</option>

                                      <option value="il" <?php if($country=="il"){

echo "selected=\\"selected\\"";



} ?>>Israel</option>

                                      <option value="ci" <?php if($country=="ci"){

echo "selected=\\"selected\\"";



} ?>>Ivory Coast (Cote D'Ivoire)</option>

                                      <option value="jm" <?php if($country=="jm"){

echo "selected=\\"selected\\"";



} ?>>Jamaica</option>

                                      <option value="jp" <?php if($country=="jp"){

echo "selected=\\"selected\\"";



} ?>>Japan</option>

                                      <option value="jo" <?php if($country=="jo"){

echo "selected=\\"selected\\"";



} ?>>Jordan</option>

                                      <option value="kz" <?php if($country=="kz"){

echo "selected=\\"selected\\"";



} ?>>Kazakhstan</option>

                                      <option value="ke" <?php if($country=="ke"){

echo "selected=\\"selected\\"";



} ?>>Kenya</option>

                                      <option value="ki" <?php if($country=="ki"){

echo "selected=\\"selected\\"";



} ?>>Kiribati</option>

                                      <option value="kw" <?php if($country=="kw"){

echo "selected=\\"selected\\"";



} ?>>Kuwait</option>

                                      <option value="kg" <?php if($country=="kg"){

echo "selected=\\"selected\\"";



} ?>>Kyrgyz Republic (Kyrgyzstan)</option>

                                      <option value="la" <?php if($country=="la"){

echo "selected=\\"selected\\"";



} ?>>Laos</option>

                                      <option value="lv" <?php if($country=="lv"){

echo "selected=\\"selected\\"";



} ?>>Latvia</option>

                                      <option value="lb" <?php if($country=="lb"){

echo "selected=\\"selected\\"";



} ?>>Lebanon</option>

                                      <option value="ls" <?php if($country=="ls"){

echo "selected=\\"selected\\"";



} ?>>Lesotho</option>

                                      <option value="lr" <?php if($country=="lr"){

echo "selected=\\"selected\\"";



} ?>>Liberia</option>

                                      <option value="ly" <?php if($country=="ly"){

echo "selected=\\"selected\\"";



} ?>>Libya</option>

                                      <option value="li" <?php if($country=="li"){

echo "selected=\\"selected\\"";



} ?>>Liechtenstein</option>

                                      <option value="lt" <?php if($country=="lt"){

echo "selected=\\"selected\\"";



} ?>>Lithuania</option>

                                      <option value="lu" <?php if($country=="lu"){

echo "selected=\\"selected\\"";



} ?>>Luxembourg</option>

                                      <option value="mo" <?php if($country=="mo"){

echo "selected=\\"selected\\"";



} ?>>Macau</option>

                                      <option value="mk" <?php if($country=="mk"){

echo "selected=\\"selected\\"";



} ?>>Macedonia</option>

                                      <option value="mg" <?php if($country=="mg"){

echo "selected=\\"selected\\"";



} ?>>Madagascar</option>

                                      <option value="mw" <?php if($country=="mw"){

echo "selected=\\"selected\\"";



} ?>>Malawi</option>

                                      <option value="my" <?php if($country=="my"){

echo "selected=\\"selected\\"";



} ?>>Malaysia</option>

                                      <option value="mv" <?php if($country=="mv"){

echo "selected=\\"selected\\"";



} ?>>Maldives</option>

                                      <option value="ml" <?php if($country=="ml"){

echo "selected=\\"selected\\"";



} ?>>Mali</option>

                                      <option value="mt" <?php if($country=="mt"){

echo "selected=\\"selected\\"";



} ?>>Malta</option>

                                      <option value="mh" <?php if($country=="mh"){

echo "selected=\\"selected\\"";



} ?>>Marshall Islands</option>

                                      <option value="mq" <?php if($country=="mq"){

echo "selected=\\"selected\\"";



} ?>>Martinique (French)</option>

                                      <option value="mr" <?php if($country=="mr"){

echo "selected=\\"selected\\"";



} ?>>Mauritania</option>

                                      <option value="mu" <?php if($country=="mu"){

echo "selected=\\"selected\\"";



} ?>>Mauritius</option>

                                      <option value="yt" <?php if($country=="yt"){

echo "selected=\\"selected\\"";



} ?>>Mayotte</option>

                                      <option value="mx" <?php if($country=="mx"){

echo "selected=\\"selected\\"";



} ?>>Mexico</option>

                                      <option value="fm" <?php if($country=="fm"){

echo "selected=\\"selected\\"";



} ?>>Micronesia</option>

                                      <option value="md" <?php if($country=="md"){

echo "selected=\\"selected\\"";



} ?>>Moldavia</option>

                                      <option value="mc" <?php if($country=="mc"){

echo "selected=\\"selected\\"";



} ?>>Monaco</option>

                                      <option value="mn" <?php if($country=="mn"){

echo "selected=\\"selected\\"";



} ?>>Mongolia</option>

                                      <option value="ms" <?php if($country=="ms"){

echo "selected=\\"selected\\"";



} ?>>Montserrat</option>

                                      <option value="ma" <?php if($country=="ma"){

echo "selected=\\"selected\\"";



} ?>>Morocco</option>

                                      <option value="mz" <?php if($country=="mz"){

echo "selected=\\"selected\\"";



} ?>>Mozambique</option>

                                      <option value="mm" <?php if($country=="mm"){

echo "selected=\\"selected\\"";



} ?>>Myanmar</option>

                                      <option value="na" <?php if($country=="na"){

echo "selected=\\"selected\\"";



} ?>>Namibia</option>

                                      <option value="nr" <?php if($country=="nr"){

echo "selected=\\"selected\\"";



} ?>>Nauru</option>

                                      <option value="np" <?php if($country=="np"){

echo "selected=\\"selected\\"";



} ?>>Nepal</option>

                                      <option value="nc" <?php if($country=="nc"){

echo "selected=\\"selected\\"";



} ?>>New Caledonia (French)</option>

                                      <option value="nz" <?php if($country=="nz"){

echo "selected=\\"selected\\"";



} ?>>New Zealand</option>

                                      <option value="ni" <?php if($country=="ni"){

echo "selected=\\"selected\\"";



} ?>>Nicaragua</option>

                                      <option value="ne" <?php if($country=="ne"){

echo "selected=\\"selected\\"";



} ?>>Niger</option>

                                      <option value="ng" <?php if($country=="ng"){

echo "selected=\\"selected\\"";



} ?>>Nigeria</option>

                                      <option value="nu" <?php if($country=="nu"){

echo "selected=\\"selected\\"";



} ?>>Niue</option>

                                      <option value="nf" <?php if($country=="nf"){

echo "selected=\\"selected\\"";



} ?>>Norfolk Island</option>

                                      <option value="kp" <?php if($country=="kp"){

echo "selected=\\"selected\\"";



} ?>>North Korea</option>

                                      <option value="om" <?php if($country=="om"){

echo "selected=\\"selected\\"";



} ?>>Oman</option>

                                      <option value="pk" <?php if($country=="pk"){

echo "selected=\\"selected\\"";



} ?>>Pakistan</option>

                                      <option value="pw" <?php if($country=="pw"){

echo "selected=\\"selected\\"";



} ?>>Palau</option>

                                      <option value="pa" <?php if($country=="pa"){

echo "selected=\\"selected\\"";



} ?>>Panama</option>

                                      <option value="pg" <?php if($country=="pg"){

echo "selected=\\"selected\\"";



} ?>>Papua New Guinea</option>

                                      <option value="py" <?php if($country=="py"){

echo "selected=\\"selected\\"";



} ?>>Paraguay</option>

                                      <option value="pe" <?php if($country=="pe"){

echo "selected=\\"selected\\"";



} ?>>Peru</option>

                                      <option value="ph" <?php if($country=="ph"){

echo "selected=\\"selected\\"";



} ?>>Philippines</option>

                                      <option value="pn" <?php if($country=="pn"){

echo "selected=\\"selected\\"";



} ?>>Pitcairn Island</option>

                                      <option value="pf" <?php if($country=="pf"){

echo "selected=\\"selected\\"";



} ?>>Polynesia (French)</option>

                                      <option value="pt" <?php if($country=="pt"){

echo "selected=\\"selected\\"";



} ?>>Portugal</option>

                                      <option value="qa" <?php if($country=="qa"){

echo "selected=\\"selected\\"";



} ?>>Qatar</option>

                                      <option value="re" <?php if($country=="re"){

echo "selected=\\"selected\\"";



} ?>>Reunion (French)</option>

                                      <option value="ro" <?php if($country=="ro"){

echo "selected=\\"selected\\"";



} ?>>Romania</option>

                                      <option value="ru" <?php if($country=="ru"){

echo "selected=\\"selected\\"";



} ?>>Russian Federation</option>

                                      <option value="rw" <?php if($country=="rw"){

echo "selected=\\"selected\\"";



} ?>>Rwanda</option>

                                      <option value="gs" <?php if($country=="gs"){

echo "selected=\\"selected\\"";



} ?>>S. Georgia &amp; S. Sandwich Isls.</option>

                                      <option value="sh" <?php if($country=="sh"){

echo "selected=\\"selected\\"";



} ?>>Saint Helena</option>

                                      <option value="kn" <?php if($country=="kn"){

echo "selected=\\"selected\\"";



} ?>>Saint Kitts &amp; Nevis Anguilla</option>

                                      <option value="lc" <?php if($country=="lc"){

echo "selected=\\"selected\\"";



} ?>>Saint Lucia</option>

                                      <option value="pm" <?php if($country=="pm"){

echo "selected=\\"selected\\"";



} ?>>Saint Pierre and Miquelon</option>

                                      <option value="st" <?php if($country=="st"){

echo "selected=\\"selected\\"";



} ?>>Saint Tome (Sao Tome) and Principe</option>

                                      <option value="vc" <?php if($country=="vc"){

echo "selected=\\"selected\\"";



} ?>>Saint Vincent &amp; Grenadines</option>

                                      <option value="ws" <?php if($country=="ws"){

echo "selected=\\"selected\\"";



} ?>>Samoa</option>

                                      <option value="sm" <?php if($country=="sm"){

echo "selected=\\"selected\\"";



} ?>>San Marino</option>

                                      <option value="sa" <?php if($country=="sa"){

echo "selected=\\"selected\\"";



} ?>>Saudi Arabia</option>

                                      <option value="sn" <?php if($country=="sn"){

echo "selected=\\"selected\\"";



} ?>>Senegal</option>

                                      <option value="sc" <?php if($country=="sc"){

echo "selected=\\"selected\\"";



} ?>>Seychelles</option>

                                      <option value="sl" <?php if($country=="sl"){

echo "selected=\\"selected\\"";



} ?>>Sierra Leone</option>

                                      <option value="sg" <?php if($country=="sg"){

echo "selected=\\"selected\\"";



} ?>>Singapore</option>

                                      <option value="sk" <?php if($country=="sk"){

echo "selected=\\"selected\\"";



} ?>>Slovak Republic</option>

                                      <option value="si" <?php if($country=="si"){

echo "selected=\\"selected\\"";



} ?>>Slovenia</option>

                                      <option value="sb" <?php if($country=="sb"){

echo "selected=\\"selected\\"";



} ?>>Solomon Islands</option>

                                      <option value="so" <?php if($country=="so"){

echo "selected=\\"selected\\"";



} ?>>Somalia</option>

                                      <option value="za" <?php if($country=="za"){

echo "selected=\\"selected\\"";



} ?>>South Africa</option>

                                      <option value="kr" <?php if($country=="kr"){

echo "selected=\\"selected\\"";



} ?>>South Korea</option>

                                      <option value="es" <?php if($country=="es"){

echo "selected=\\"selected\\"";



} ?>>Spain</option>

                                      <option value="lk" <?php if($country=="lk"){

echo "selected=\\"selected\\"";



} ?>>Sri Lanka</option>

                                      <option value="sd" <?php if($country=="sd"){

echo "selected=\\"selected\\"";



} ?>>Sudan</option>

                                      <option value="sr" <?php if($country=="sr"){

echo "selected=\\"selected\\"";



} ?>>Suriname</option>

                                      <option value="sj" <?php if($country=="sj"){

echo "selected=\\"selected\\"";



} ?>>Svalbard and Jan Mayen Islands</option>

                                      <option value="sz" <?php if($country=="sz"){

echo "selected=\\"selected\\"";



} ?>>Swaziland</option>

                                      <option value="ch" <?php if($country=="ch"){

echo "selected=\\"selected\\"";



} ?>>Switzerland</option>

                                      <option value="sy" <?php if($country=="sy"){

echo "selected=\\"selected\\"";



} ?>>Syria</option>

                                      <option value="tj" <?php if($country=="tj"){

echo "selected=\\"selected\\"";



} ?>>Tadjikistan</option>

                                      <option value="tw" <?php if($country=="tw"){

echo "selected=\\"selected\\"";



} ?>>Taiwan</option>

                                      <option value="tz" <?php if($country=="tz"){

echo "selected=\\"selected\\"";



} ?>>Tanzania</option>

                                      <option value="th" <?php if($country=="th"){

echo "selected=\\"selected\\"";



} ?>>Thailand</option>

                                      <option value="tg" <?php if($country=="tg"){

echo "selected=\\"selected\\"";



} ?>>Togo</option>

                                      <option value="tk" <?php if($country=="tk"){

echo "selected=\\"selected\\"";



} ?>>Tokelau</option>

                                      <option value="to" <?php if($country=="to"){

echo "selected=\\"selected\\"";



} ?>>Tonga</option>

                                      <option value="tt" <?php if($country=="tt"){

echo "selected=\\"selected\\"";



} ?>>Trinidad and Tobago</option>

                                      <option value="tn" <?php if($country=="tn"){

echo "selected=\\"selected\\"";



} ?>>Tunisia</option>

                                      <option value="tr" <?php if($country=="tr"){

echo "selected=\\"selected\\"";



} ?>>Turkey</option>

                                      <option value="tm" <?php if($country=="tm"){

echo "selected=\\"selected\\"";



} ?>>Turkmenistan</option>

                                      <option value="tc" <?php if($country=="tc"){

echo "selected=\\"selected\\"";



} ?>>Turks and Caicos Islands</option>

                                      <option value="tv" <?php if($country=="tv"){

echo "selected=\\"selected\\"";



} ?>>Tuvalu</option>

                                      <option value="ug" <?php if($country=="ug"){

echo "selected=\\"selected\\"";



} ?>>Uganda</option>

                                      <option value="ua" <?php if($country=="ua"){

echo "selected=\\"selected\\"";



} ?>>Ukraine</option>

                                      <option value="ae" <?php if($country=="ae"){

echo "selected=\\"selected\\"";



} ?>>United Arab Emirates</option>

                                      <option value="uk" <?php if($country=="uk"){

echo "selected=\\"selected\\"";



} ?>>United Kingdom</option>

                                      <option value="uy" <?php if($country=="uy"){

echo "selected=\\"selected\\"";



} ?>>Uruguay</option>

                                      <option value="uz" <?php if($country=="uz"){

echo "selected=\\"selected\\"";



} ?>>Uzbekistan</option>

                                      <option value="vu" <?php if($country=="vu"){

echo "selected=\\"selected\\"";



} ?>>Vanuatu</option>

                                      <option value="ve" <?php if($country=="ve"){

echo "selected=\\"selected\\"";



} ?>>Venezuela</option>

                                      <option value="vn" <?php if($country=="vn"){

echo "selected=\\"selected\\"";



} ?>>Vietnam</option>

                                      <option value="vg" <?php if($country=="vg"){

echo "selected=\\"selected\\"";



} ?>>Virgin Islands (British)</option>

                                      <option value="wf" <?php if($country=="wf"){

echo "selected=\\"selected\\"";



} ?>>Wallis and Futuna Islands</option>

                                      <option value="eh" <?php if($country=="eh"){

echo "selected=\\"selected\\"";



} ?>>Western Sahara</option>

                                      <option value="ye" <?php if($country=="ye"){

echo "selected=\\"selected\\"";



} ?>>Yemen</option>

                                      <option value="yu" <?php if($country=="yu"){

echo "selected=\\"selected\\"";



} ?>>Yugoslavia</option>

                                      <option value="zr" <?php if($country=="zr"){

echo "selected=\\"selected\\"";



} ?>>Zaire</option>

                                      <option value="zm" <?php if($country=="zm"){

echo "selected=\\"selected\\"";



} ?>>Zambia</option>

                                      <option value="zw" <?php if($country=="zw"){

echo "selected=\\"selected\\"";



} ?>>Zimbabwe</option>

                                    </select></td>

							<td></td>

						</tr>

						<tr>

						  <td class="bold">&nbsp;</td>

						  <td>&nbsp;</td>

						  <td></td>

					  </tr>

						<tr>

							<td class="bold">Phone Number:</td>

							<td><input name="phone" type="text" class="normal" id="phone" style="width:180px;" value="<?php  echo "$phone"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>

							<td></td>

						</tr>

						<tr>

						  <td class="bold">&nbsp;</td>

						  <td>&nbsp;</td>

						  <td></td>

					  </tr>

					  <tr>

							<td class="bold">Personal question :</td>

							<td><SELECT id="secques" name="secques">

                              <OPTION value="What's my mother's first name?" selected>What's my mother's first name?</OPTION>

                              <OPTION value="What's my favourite hobby?">What's my favourite hobby?</OPTION>

                              <OPTION value="What's my favourite sport club?">What's my favourite sport club?</OPTION>

                              <OPTION value="What's the name of my favourite book?">What's the name of my   favourite book?</OPTION>

                              <OPTION value="Who was my childhood hero?">Who was my   childhood hero?</OPTION>

                              <OPTION value="What's my best friend's name?">What's my   best friend's name?</OPTION>

                              <OPTION value="What's the name of my pet?">What's   the name of my pet?</OPTION>

                              <OPTION value="What's my nickname?">What's my   nickname?</OPTION>

                              <OPTION value="What was the make of my first car?">What was   the make of my first car?</OPTION>

                              <OPTION value="What's my secret code?">What's   my secret code?</OPTION>

							  </SELECT></td>

							<td></td>

					  </tr>

					  <tr>

							<td class="bold">Personal answer: </td>

							<td><input name="secans" type="text" class="normal" id="secans" style="width:180px;" value="<?php  echo "$secans"; ?>" error="Please retype your password" error2="Your password and retyped password do not match" errorspaces="Please do not use spaces in your password"/></td>

							<td></td>

					  </tr>

						<tr>

							<td class="bold">One more question: </td>

							<td><SELECT id="whereknowfrom" name="whereknowfrom">

                              <OPTION value="N/A" selected>How did   you get to know of us?</OPTION>

                              <OPTION value="Internet Advertising">Internet   advertising</OPTION>

                              <OPTION value="E-Mail">E-mail</OPTION>

                              <OPTION value="Search Engine">Search engine</OPTION>

                              <OPTION value="Friend/colleague">Friend/colleague</OPTION>

                              <OPTION value="Television">Television</OPTION>

                              <OPTION value="Radio">Radio</OPTION>

                              <OPTION value="Newspaper/magazine">Newspaper/magazine</OPTION>

                              <OPTION value="Event/function">Event/function</OPTION>

                              <OPTION value="Poster/billboard">Poster/billboard</OPTION>

                              <OPTION value="Flyers">Flyers</OPTION>

                              <OPTION value="Other">Other</OPTION>

						    </SELECT></td>

							<td></td>

						</tr>

						<tr>

							<td colspan="3">

							<input id="offers" name="offers" type="hidden" value="3" />							</td>

						</tr>
						<tr>
							<td colspan="3" height="30">
                                By pressing PROCEED I agree to the
								<a href="index.php?page=terms_and_conditions" target="_blank">terms and conditions</a> and confirm that I am of 18 years or over.							</td>
						</tr>
				  </table>
						<table class="mainContentFooterBar" cellspacing="0" cellpadding="0" border="0">
						<tr>
							<td width="100%" height="26" style="padding-left:5px;padding-right:5px;">
								<input id="reg_your_details_submit" style="float:right;" type="submit" value="Proceed">
							</td>
						</tr>
					</table>
					<img id="tcImage" style="display:none;"> </img> <!-- Touch Clarity -->
				</form>
		  </td>
		</tr>
	</table>
	<!-- footer holder -->
	<div id="footer" class="regFooter">
		<!-- trust e goes in the footer during registration -->
	  <div id="regTrust"></div>
	</div>
</div>
<!-- Error Msg Handling -->

edit_do_open_account.php

&lt;?
/***********************************************************************

************************************************************************/
include ("config.php");
include ("../dbcon.php");
include ("functions.php");
$user_ip_address  =  $HTTP_SERVER_VARS["REMOTE_ADDR"]; /*Fetch the user's IP Address */
if($firstname=="" or $lastname=="" or $gender=="" or $street=="" or $zip=="" or $city=="" or $country =="" or $email=="" or $phone=="" or $uid=="" or $pass1=="" or $pass2=="" or $secques=="" or $secans=="" or $dobd=="" or $doby=="" or $dobm==""){
Header("Location: ../index.php?page=open_account&error=Please fill out all mandatory form fields!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit; }
if (!eregi("^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$", $email))
{
Header("Location: ../index.php?page=open_account&error=You did not provide a valid e-mail address. Please re-check you entered your details correctly!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
$resultu=mysql_query("select * from jsgamingcenter_users where email='$email'", $casdb);
$usert1=mysql_fetch_array($resultu);
$resultm=mysql_query("select * from jsgamingcenter_users where login='$uid'", $casdb);
$usert2=mysql_fetch_array($resultm);
if ($email==$usert1[6])
{
Header("Location: ../index.php?page=open_account&error=There is already a user registered with the e-mail address provided!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if ($uid==$usert2[1])
{
Header("Location: ../index.php?page=open_account&error=This UserID already exists!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if ($pass1!=$pass2)
{
Header("Location: ../index.php?page=open_account&error=Your passwords did not match. Please try again.&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if(strlen($uid) &lt; 6 ){
Header("Location: ../index.php?page=open_account&error=Your UserID must be longer than 6 characters.&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if(strlen($pass1) &lt; 6 ){
Header("Location: ../index.php?page=open_account&error=Your password must be longer than 6 characters.&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if(strlen($uid) &gt; 25 ){
Header("Location: ../index.php?page=open_account&error=Your UserID is too long!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if(strlen($pass1) &gt; 25 ){
Header("Location: ../index.php?page=open_account&error=Your password is too long!&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if (!eregi("^[0-9]+$", $phone))
{
Header("Location: ../index.php?page=open_account&error=You did not provide a valid phone number (numeric-values only!)&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if (!eregi("^[0-9]+$", $zip))
{
Header("Location: ../index.php?page=open_account&error=You did not provide a valid ZIP Code number (numeric-values only!)&firstname=$firstname&lastname=$lastname&gender=$gender&street=$street&zip=$zip&city=$city&state=$state&country=$country&email=$email&phone=$phone&uid=$uid&secques=$secques&secans=$secans&whereknowfrom=$whereknowfrom");
exit;
}
if($emailupdates1=="1"){
$newsletter =0;
}
else{
$newsletter =1;
}
$checkcode=md5(rand(00000000000000000,999999999999999999));
$checkcode=strtoupper($checkcode);
$date=date("d/m/y");
$time=date("g:i a");
mysql_query("INSERT INTO `jsgamingcenter_users` VALUES('', '$uid', '$pass1', '0', '0', '0', '$email', '$firstname', '$lastname', '$date $time', '0', '$checkcode', '$gender', '$street', '$zip', '$city', '$country', '$dobm/$dobd/$doby', '$phone', '0', '$secques', '$secans', '$whereknowfrom', '$newsletter', '0', 'n/a', 'n/a', 'n/a', '0', '', '', '', '', '', '$user_ip_address', 'None recorded', 'NO')", $casdb);
mysql_query("INSERT INTO `jsgamingcenter_userdetailshistory` VALUES('', '$uid', '$pass1', '0', '0', '0', '$email', '$firstname', '$lastname', '$date $time', '0', '$checkcode', '$gender', '$street', '$zip', '$city', '$country', '$dobm/$dobd/$doby', '$phone', '0', '$secques', '$secans', '$whereknowfrom', '$newsletter', '0', 'n/a', 'n/a', 'n/a', '0', '', '', '', '', '', '$user_ip_address', 'None recorded', 'NO', '$date $time')", $casdb);
$resultu=mysql_query("select * from jsgamingcenter_emails where id='1'", $casdb);
$theemail=mysql_fetch_array($resultu);
$conf=mysql_fetch_array(mysql_query("select * from jsgamingcenter_settings", $casdb));
$message = $theemail['3']; eval("\\$message = \\"$message\\";");
mail("$email", "$theemail[2]", "$message", "From: $casinoname &lt;$conf[5];&gt;");
Header("Location: ../index.php?page=open_account_2");
?&gt;

engine_accactivation.php

&lt;?
/***********************************************************************

USER ACCOUNT ACTIVATION ENGINE
v1.0
************************************************************************/
include ("includes/config.php");
include ("dbcon.php");
include ("includes/functions.php");
$resultu=mysql_query("select * from jsgamingcenter_users where email='$email'", $casdb);
$usert1=mysql_fetch_array($resultu);
if ($acd==$usert1[11] && $usert1[24]=='0')
{
mysql_query("UPDATE jsgamingcenter_users set status='1' where email='$email'", $casdb);
/***********************************************************************
SEND WELCOME EMAIL TO USER
************************************************************************/
$resultu=mysql_query("select * from jsgamingcenter_emails where id='2'", $casdb);
$theemail=mysql_fetch_array($resultu);
$conf=mysql_fetch_array(mysql_query("select * from jsgamingcenter_settings", $casdb));
$message = $theemail['3']; eval("\\$message = \\"$message\\";");
mail("$email", "$theemail[2]", "$message", "From: $casinoname &lt;$conf[5];&gt;");
Header("Location: activate.php?s=f");
exit;
}
if ($acd!=$usert1[11])
{
Header("Location: activate.php?s=failed");
exit;
}
if ($usert1[24]!='0')
{
Header("Location: activate.php?s=alact");
exit;
}
?&gt;

activate.php

&lt;?
/***********************************************************************

FRONT-END USER ACCOUNT ACTIVATION
v1.0
************************************************************************/
include ("includes/config.php");
include ("dbcon.php");
if($s=="f"){
Header("Location: index.php?page=account_activation_complete");
exit;
}
if($s=="failed"){
Header("Location: index.php?page=account_activation_failed");
exit;
}
if($s=="alact"){
Header("Location: index.php?page=account_activation_alreadyactivated");
exit;
}
if($s=="1"){
include ("includes/engine_accactivation.php");
}
?&gt;

Welcome to the SP forums.
I’ve moved your question to a more appropriate forum.

What error message do you get?

Or more appropriately, what page are you getting sent to? activation.php?s=f, activation.php?s=failed, or activation.php?s=alact? If it’s either of the latter ones, the email sending isnt failing, it’s never being attempted.

well i get the account_activation_failed page

i get the s=1 but i think thats default on the webpage as on email registration it sends following code

Dear $firstname $lastname,

Thanks for your Account Registration at $casinoname !

Please activate your account by clicking the following link:

http://www.$maindomain/activate.php?s=1&email=$email&acd=$checkcode

Your login details are:

Username: $uid
Password: $pass1

Thanks again for registering an account at $casinoname,

$casinoname

if you get to account_activation_failed, then this was true:
if ($acd!=$usert1[11])

so you’ve got some unexpected input.

but i think the code i gave you earlier is located in my admin panel for sending email verification and shows s=1 but i changed that to s=f but still it will tell me account activated although it is not because i do not see any of the data in the datbase under jsgamingcenter_users where there should be username …etc with the checkcodes that should all be verified if they match. Do not know why information is not pssed into database when i hope commands are telling this to me inputted there? with mysql query…etc

Output the data from the query may give you clue as why it fails.

For example, on engine_accactivation.php insert the code below after the query:

echo “acd = ($acd)<br/><pre>”;
print_R($usert1);

<?
/***********************************************************************

USER ACCOUNT ACTIVATION ENGINE
v1.0
************************************************************************/
include ("includes/config.php");
include ("dbcon.php");
include ("includes/functions.php");
$resultu=mysql_query("select * from jsgamingcenter_users where email='$email'", $casdb);
$usert1=mysql_fetch_array($resultu);

echo "acd = ($acd)<br><pre>";
print_R($usert1);

if ($acd==$usert1[11] && $usert1[24]=='0')
{
mysql_query("UPDATE jsgamingcenter_users set status='1' where email='$email'", $casdb);
/***********************************************************************
SEND WELCOME EMAIL TO USER
************************************************************************/
$resultu=mysql_query("select * from jsgamingcenter_emails where id='2'", $casdb);
$theemail=mysql_fetch_array($resultu);
$conf=mysql_fetch_array(mysql_query("select * from jsgamingcenter_settings", $casdb));
$message = $theemail['3']; eval("\\$message = \\"$message\\";");
mail("$email", "$theemail[2]", "$message", "From: $casinoname <$conf[5];>");
Header("Location: activate.php?s=f");
exit;
}
if ($acd!=$usert1[11])
{
Header("Location: activate.php?s=failed");
exit;
}
if ($usert1[24]!='0')
{
Header("Location: activate.php?s=alact");
exit;
}
?>

ok

the data i get when code is inserted is as follows

acd = (DC0574B5774DA3CA9A3DB34F945D3169)

and when i get an email activation link the code is identical to that above

http://www.xxxxxxxxxx.net/activate.php?s=1&email=andrew.alltech@yahoo.com&acd=DC0574B5774DA3CA9A3DB34F945D3169

When i look at jsgamingcenter_users there is no contact info in the database for some reason???

Looks like you did not get anything from the database.

Make sure your select statement is valid and $email is correct:

“select * from jsgamingcenter_users where email=‘$email’”

have looked at statements in do_open_account.php and engine_accactivation.php and all seems fine? here is my sql for jsgaming_users.sql…please not there is user in there for test and this was already in there when i received code and the user logs in fine and all there info is ok. I think the problem lies with the information when opening account is not submitted to DB so therfore cannot activate if no user info in DB although the activation email i got was

http://www.xxx.net/activate.php?s=1&email=andrew.alltech@yahoo.com&acd=DC0574B5774DA3CA9A3DB34F945D3169

please right click on link then properties to see all code and you will see my email address is in there. Please also find SQL below for jsgamingcenter_users. i am very confused to where the problem lies

– phpMyAdmin SQL Dump
– version 3.4.10.1
http://www.phpmyadmin.net

– Host: 10.111.16.45:3306
– Generation Time: May 22, 2012 at 05:25 PM
– Server version: 5.1.61
– PHP Version: 5.3.10

SET SQL_MODE=“NO_AUTO_VALUE_ON_ZERO”;
SET time_zone = “+00:00”;

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/
!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/
!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/
!40101 SET NAMES utf8 */;


– Database: xxxxxxxx_net



– Table structure for table jsgamingcenter_users

CREATE TABLE IF NOT EXISTS jsgamingcenter_users (
id int(11) NOT NULL AUTO_INCREMENT,
login varchar(100) DEFAULT NULL,
pass varchar(100) DEFAULT NULL,
cash decimal(12,2) DEFAULT ‘0.00’,
cashin decimal(12,2) DEFAULT ‘0.00’,
cashout decimal(12,2) DEFAULT ‘0.00’,
email varchar(100) DEFAULT NULL,
name varchar(50) DEFAULT NULL,
fam varchar(50) DEFAULT NULL,
date varchar(120) DEFAULT NULL,
pcash varchar(6) DEFAULT ‘0.00’,
confirmcode varchar(50) DEFAULT NULL,
gender varchar(33) NOT NULL DEFAULT ‘’,
street varchar(100) NOT NULL DEFAULT ‘’,
zip varchar(100) NOT NULL DEFAULT ‘’,
ort varchar(100) NOT NULL DEFAULT ‘’,
country varchar(100) NOT NULL DEFAULT ‘’,
dob varchar(33) NOT NULL DEFAULT ‘’,
mobiletel varchar(33) NOT NULL DEFAULT ‘’,
email2 varchar(33) NOT NULL DEFAULT ‘’,
secques varchar(33) NOT NULL DEFAULT ‘’,
secans varchar(33) NOT NULL DEFAULT ‘’,
whereknowfrom varchar(33) NOT NULL DEFAULT ‘’,
noemails char(1) NOT NULL DEFAULT ‘’,
status char(1) NOT NULL DEFAULT ‘’,
admin_notes text NOT NULL,
operator_notes text NOT NULL,
status_message text NOT NULL,
cc_availible char(1) NOT NULL DEFAULT ‘’,
cc_type char(1) NOT NULL DEFAULT ‘’,
cc_number char(200) NOT NULL DEFAULT ‘’,
cc_exp_month char(2) NOT NULL DEFAULT ‘’,
cc_exp_year char(4) NOT NULL DEFAULT ‘’,
cc_nameoncard varchar(50) DEFAULT NULL,
ip_reg varchar(30) NOT NULL DEFAULT ‘’,
ip_last varchar(30) NOT NULL DEFAULT ‘’,
identityverified varchar(30) NOT NULL DEFAULT ‘’,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;


– Dumping data for table jsgamingcenter_users

INSERT INTO jsgamingcenter_users (id, login, pass, cash, cashin, cashout, email, name, fam, date, pcash, confirmcode, gender, street, zip, ort, country, dob, mobiletel, email2, secques, secans, whereknowfrom, noemails, status, admin_notes, operator_notes, status_message, cc_availible, cc_type, cc_number, cc_exp_month, cc_exp_year, cc_nameoncard, ip_reg, ip_last, identityverified) VALUES
(1, ‘guestlogin’, ‘guestlogin’, ‘4999.85’, ‘0.00’, ‘0.00’, ‘guest@guest’, ‘GUEST’, ‘GUEST’, ‘00/00/00 0:00 pm’, ‘0’, ‘n/a’, ‘n/a’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘N/A’, ‘1’, ‘1’, ‘THIS USER IS NEEDED FOR THE CASINO PLAY FOR FUN ENGINE -> DO NOT REMOVE FROM DATABASE’, ‘THIS USER IS NEEDED FOR THE CASINO PLAY FOR FUN ENGINE -> DO NOT REMOVE FROM DATABASE’, ‘PLAY FOR FUN ENGINE - DO NOT REMOVE’, ‘N’, ‘N’, ‘N/A’, ‘N/’, ‘N/A’, ‘’, ‘none’, ‘none’, ‘0’),
(4, ‘demouser’, ‘demouser’, ‘130.65’, ‘0.00’, ‘0.00’, ‘casinoflashscript@x.com’, ‘demouser’, ‘demouser’, ‘24/02/09 5:34 am’, ‘0’, ‘D188A93E25A55B46B88B5BD25BC94CDD’, ‘M’, ‘demouser’, ‘555555’, ‘demouser’, ‘bh’, ‘02/27/1962’, ‘5555555’, ‘0’, ‘What’‘s my favourite hobby?’, ‘demouser’, ‘E-Mail’, ‘0’, ‘1’, ‘n/a’, ‘n/a’, ‘n/a’, ‘0’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘202.156.12.237’, ‘195.195.244.38’, ‘NO’);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/
!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/
!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

When you inserted print_R() for the test it should display the record retrieved from the database, instead it show nothing so I believe the select statement might be incorrect or there is no record with that email.

Update the test script, this time includes showing the email:

<?
/***********************************************************************

USER ACCOUNT ACTIVATION ENGINE
v1.0
************************************************************************/
include ("includes/config.php");
include ("dbcon.php");
include ("includes/functions.php");
$resultu=mysql_query("select * from jsgamingcenter_users where email='$email'", $casdb);
$usert1=mysql_fetch_array($resultu);

echo "acd = ($acd) email = ($email)<br><pre>";
print_R($usert1);

if ($acd==$usert1[11] && $usert1[24]=='0')
{
mysql_query("UPDATE jsgamingcenter_users set status='1' where email='$email'", $casdb);
/***********************************************************************
SEND WELCOME EMAIL TO USER
************************************************************************/
$resultu=mysql_query("select * from jsgamingcenter_emails where id='2'", $casdb);
$theemail=mysql_fetch_array($resultu);
$conf=mysql_fetch_array(mysql_query("select * from jsgamingcenter_settings", $casdb));
$message = $theemail['3']; eval("\\$message = \\"$message\\";");
mail("$email", "$theemail[2]", "$message", "From: $casinoname <$conf[5];>");
Header("Location: activate.php?s=f");
exit;
}
if ($acd!=$usert1[11])
{
Header("Location: activate.php?s=failed");
exit;
}
if ($usert1[24]!='0')
{
Header("Location: activate.php?s=alact");
exit;
}
?>

placed above code in and just get same error page as without code namely

http://www.xxx.net/index.php?page=account_activation_failed

I’m at a loss of what else to do. If I come across something that might help to identify the problems I will let you know. Meanwhile hope other members here will spot something.

thanks tom for all your help…would it be consideration if you looked at my site itself…obvioisly its not complete fully yet but if i reset passwords on my hosting company you cou;ld actually take a look at the problem. I think there is something slightly missing somewhere but 99% of the sql is working. As stated before i acquired the coding and there is 1 test name in account which obviously works and collates all data correctly but its just the registerng new users thats the problem and that a database with their details does not seeem to be created. Let me know if you would be kind enough to take a look at my site then i can set up admin right for you

Thank you

I love to do that. Sometime it is very difficult in pinpointing the problem by exchanging info. Not only it is time consuming but may leave out needed detail. If you can set up a test site that would be great as this will not disturb you live site. But if it can’t be done, I will run the test with care as long as it is ok with you. Please PM me with the info.

ok will do that and let you now. by the way, the code you placed in lastime showed up acd with the correct code and email as my email address so that does match with activation link yet seems to not activate because not in database i will reply shortly with site address

can you email me at azevedofrancisco911@yahoo.co.uk so i can give you login details to www.gameroyal.co.uk