[Help] Register.php That ask for Email

04/18/2010 20:47 DaLaughinMan8#1
I would like my register page to ask for the person's email. That way if I need to reset their password I can send it straight to their email.

So can someone show me a guild or some way that I can edit this?
04/18/2010 22:58 Knight^Hawk#2
copy and paste this in ur registur.php

Code:
<?php
include('config.php');
?>
<script type="text/javascript" src="./inc/md5.js"></script>
<form method='post' action='register.php?act=register'>
<b><strong>Please make sure you remember your Account ID and Password</strong></b><hr>
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="64" valign="top"></td>
<td valign="top">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr><td><strong>Account ID:</strong></td>
<td width="66%"><input type="text" size="30" maxlength="15" name="id" id="id" title="* Only 4-15 Words/number"></td></tr>
<tr><td><strong>Password:</strong></td>
<td><input class=it id="ipassword" type="password" size="30" maxlength="15" name=pass title="* Only 4-15 Words/number"></td></tr>
<tr><td><strong>Retype Password:</strong></td>
<td><input class=it1 id="ipassword" type="password" size="30" maxlength="15" name=retpass title="* Only 4-15 Words/number"></td></tr>
<tr><td><strong>Email</strong></td>
<td width="66%"><input type="text" size="30" maxlength="30" name="email" id="email" title="* Use a valid email"></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<br /><br />
<TABLE align="center">
<tr><td align="center"><input type="hidden" name="hash"><input class=Butt type=submit onclick="hash.value = login(pass.value)" value='register' name=B1></td></tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php
                        if($_GET['act'] == "register")
                                {
                                        mysql_select_db($mydbacc);
                                        $userid = trim($_POST['id']);
                                        $password=trim($_POST['pass']);
                                        $passretype=trim($_POST['retpass']);
                                        $hash=$_POST['hash'];
					$_SERVER['REMOTE_ADDR'];
                                        $email = $_REQUEST['email'];
                                         if($userid=="" || $password=="" || $passretype=="" )
                                         {
                                                echo "<center>You must fill all information in the Required Field!</center>";
                                         }
                                         else
                                         {
                                             if($password == $passretype)
                                                 {
                                                  if(!ereg("^[0-9a-z]{4,15}$",$userid))
                                                  {
                                                        echo "<center>Only letters and numbers only are allowed.Long 4 to 15 words</center>";
                                                        }
                                                        else
                                                        {
                                                                $res = mysql_query("select * from account where name = '".$userid."' order by id desc");
                                                                if(mysql_num_rows($res) == 0)
                                                                {
                                                                        mysql_query("insert into account (name,Password,Reg_date,netbar_ip,email) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."','".$_SERVER['REMOTE_ADDR']."','".$email."')");
									echo "<center>Account successfully registered!</center>";
                                                                }
                                                                else
                                                                {
                                                                        echo "<center>This account has been registered, please select another!</center>";
                                                                }
                                                        }
                                                }
                                                else
                                                {
                                                        echo "<center>Password authentication is not the same as your Password</center>";
                                                }
                                        }
                                }
                        ?>
04/18/2010 23:26 DaLaughinMan8#3
Ok so far the only problem that I'm getting is that if I put it in the "pages" folder it would just send me to a blank page when I click the register button. Is there a way I can fix that?
04/18/2010 23:35 Knight^Hawk#4
that has something to do with ur index.php i believe
04/19/2010 00:06 DaLaughinMan8#5
I got it to work now I took a few of the lines you had and added to the register.php I was using. Now if only I remember how I change the ip limit. I thought I backup my register but it turn out to be the very first one that had the problem with the ip limit. I guess that's what i get for not double checking it.

Thanks again for the help
04/19/2010 00:44 PraDevil[ELITE]#6
Quote:
Originally Posted by Knight^Hawk View Post
copy and paste this in ur registur.php

...........
atleast leave credit to me coz make it..
04/19/2010 01:03 Knight^Hawk#7
um no u didnt i copied and pasted it from my register script
04/19/2010 03:02 .Ash#8
no point of having to ask them for thier email and not have it down anywhere...

Heres how to do it, dump sql of your account table, add this line
Code:
`email` varchar(32) default NULL,
and run that sql again. and point the register.php to it..
04/19/2010 03:15 DaLaughinMan8#9
Quote:
Originally Posted by SpongeBox View Post
no point of having to ask them for thier email and not have it down anywhere...

Heres how to do it, dump sql of your account table, add this line
Code:
`email` varchar(32) default NULL,
and run that sql again. and point the register.php to it..
My account table already had the email column I just never could find a register.php that ask for it. Thanks for the heads up