ok i want to change my date of birth option to drop down menu both in register and uaser setting how?
here is an expale
here is an expale
function registerform($ef) { $ue = $errl = $pe = $ce = ""; switch($ef) { case 1: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Please type your Username"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 2: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Please type your password"; $pe = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 3: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Please type your password again"; $ce = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 4: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Username is invalid"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 5: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Password is invalid"; $pe = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 6: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Passwords doesn't match"; $ce = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 7: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Username must be 4 characters or more"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 8: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Password must be 4 characters or more"; $pe = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 9: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Username already in use, choose a different one"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 10: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Unknown mysql error try registering later"; break; case 11: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Username must start with a letter from a-z"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 12: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Username is reserved for admins of the site"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 13: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> Please choose an appropriate username"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 14: $errl = "<img src=\"../images/point.gif\" alt=\"!\"/> U must enter an email address"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; } $rform = "$ue Username: <input name=\"tfuid\" format=\"*x\" maxlength=\"15\"/> "; $rform .= "$pe Password: <input type=\"password\" name=\"tfpwd\" format=\"*x\" maxlength=\"30\"/> "; $rform .= "$ce Password: <input type=\"password\" name=\"tfcpw\" format=\"*x\" maxlength=\"30\"/> "; $rform .= "<img src=\"../images/point.gif\" alt=\"!\"/>Date Of Birth: "; $rform .= "<select name=\"day\" value=\"01\">"; $rform .= "<option value=\"01\">1</option>"; $rform .= "<option value=\"02\">2</option>"; $rform .= "<option value=\"03\">3</option>"; $rform .= "<option value=\"04\">4</option>"; $rform .= "<option value=\"05\">5</option>"; $rform .= "<option value=\"06\">6</option>"; $rform .= "<option value=\"07\">7</option>"; $rform .= "<option value=\"08\">8</option>"; $rform .= "<option value=\"09\">9</option>"; $rform .= "<option value=\"10\">10</option>"; $rform .= "<option value=\"11\">11</option>"; $rform .= "<option value=\"12\">12</option>"; $rform .= "<option value=\"13\">13</option>"; $rform .= "<option value=\"14\">14</option>"; $rform .= "<option value=\"15\">15</option>"; $rform .= "<option value=\"16\">16</option>"; $rform .= "<option value=\"17\">17</option>"; $rform .= "<option value=\"18\">18</option>"; $rform .= "<option value=\"19\">19</option>"; $rform .= "<option value=\"20\">20</option>"; $rform .= "<option value=\"21\">21</option>"; $rform .= "<option value=\"22\">22</option>"; $rform .= "<option value=\"23\">23</option>"; $rform .= "<option value=\"24\">24</option>"; $rform .= "<option value=\"25\">25</option>"; $rform .= "<option value=\"26\">26</option>"; $rform .= "<option value=\"27\">27</option>"; $rform .= "<option value=\"28\">28</option>"; $rform .= "<option value=\"29\">29</option>"; $rform .= "<option value=\"30\">30</option>"; $rform .= "<option value=\"31\">31</option>"; $rform .= "</select> "; $rform .= "<select name=\"month\" value=\"01-\">"; $rform .= "<option value=\"01-\">Jan</option>"; $rform .= "<option value=\"02-\">Feb</option>"; $rform .= "<option value=\"03-\">Mar</option>"; $rform .= "<option value=\"04-\">Apr</option>"; $rform .= "<option value=\"05-\">May</option>"; $rform .= "<option value=\"06-\">Jun</option>"; $rform .= "<option value=\"07-\">Jul</option>"; $rform .= "<option value=\"08-\">Aug</option>"; $rform .= "<option value=\"09-\">Sep</option>"; $rform .= "<option value=\"10-\">Oct</option>"; $rform .= "<option value=\"11-\">Nov</option>"; $rform .= "<option value=\"12-\">Dec</option>"; $rform .= "</select> "; $rform .= "<select name=\"year\" value=\"1992-\">"; $rform .= "<option value=\"1992-\">1992</option>"; $rform .= "<option value=\"1991-\">1991</option>"; $rform .= "<option value=\"1990-\">1990</option>"; $rform .= "<option value=\"1989-\">1989</option>"; $rform .= "<option value=\"1988-\">1988</option>"; $rform .= "<option value=\"1987-\">1987</option>"; $rform .= "<option value=\"1986-\">1986</option>"; $rform .= "<option value=\"1985-\">1985</option>"; $rform .= "<option value=\"1984-\">1984</option>"; $rform .= "<option value=\"1983-\">1983</option>"; $rform .= "<option value=\"1982-\">1982</option>"; $rform .= "<option value=\"1981-\">1981</option>"; $rform .= "<option value=\"1980-\">1980</option>"; $rform .= "<option value=\"1979-\">1979</option>"; $rform .= "<option value=\"1978-\">1978</option>"; $rform .= "<option value=\"1977-\">1977</option>"; $rform .= "<option value=\"1976-\">1976</option>"; $rform .= "<option value=\"1975-\">1975</option>"; $rform .= "<option value=\"1974-\">1974</option>"; $rform .= "<option value=\"1973-\">1973</option>"; $rform .= "<option value=\"1972-\">1972</option>"; $rform .= "<option value=\"1971-\">1971</option>"; $rform .= "<option value=\"1970-\">1970</option>"; $rform .= "<option value=\"1979-\">1979</option>"; $rform .= "<option value=\"1978-\">1978</option>"; $rform .= "<option value=\"1977-\">1977</option>"; $rform .= "<option value=\"1976-\">1976</option>"; $rform .= "<option value=\"1975-\">1975</option>"; $rform .= "<option value=\"1974-\">1974</option>"; $rform .= "<option value=\"1973-\">1973</option>"; $rform .= "<option value=\"1972-\">1972</option>"; $rform .= "<option value=\"1971-\">1971</option>"; $rform .= "<option value=\"1970-\">1970</option>"; $rform .= "<option value=\"1969-\">1969</option>"; $rform .= "<option value=\"1968-\">1968</option>"; $rform .= "<option value=\"1967-\">1967</option>"; $rform .= "<option value=\"1966-\">1966</option>"; $rform .= "</select> "; $rform .= "Sex:"; $rform .= "<select name=\"opsex\" value=\"M\">"; $rform .= "<option value=\"M\">Male</option>"; $rform .= "<option value=\"F\">Female</option>"; $rform .= "</select> "; $rform .= "Country: <input name=\"tfloc\" maxlength=\"100\"/> "; $rform .= "Email: <input name=\"email\" maxlength=\"50\"/> "; $rform .= "Info: <input name=\"info\" maxlength=\"100\"/> "; $rform .= "<anchor>Register"; $rform .= "<go href=\"register.php\" method=\"post\">"; $rform .= "<postfield name=\"uid\" value=\"$(tfuid)\"/>"; $rform .= "<postfield name=\"pwd\" value=\"$(tfpwd)\"/>"; $rform .= "<postfield name=\"cpw\" value=\"$(tfcpw)\"/>"; $rform .= "<postfield name=\"day\" value=\"$(day)\"/>"; $rform .= "<postfield name=\"month\" value=\"$(month)\"/>"; $rform .= "<postfield name=\"year\" value=\"$(year)\"/>"; $rform .= "<postfield name=\"usx\" value=\"$(opsex)\"/>"; $rform .= "<postfield name=\"ulc\" value=\"$(tfloc)\"/>"; $rform .= "<postfield name=\"email\" value=\"$(email)\"/>"; $rform .= "<postfield name=\"info\" value=\"$(info)\"/>"; $rform .= "</go></anchor> "; $rform .= " $errl"; return $rform; }
/////register form function getnewgml($uid) { /* global $onver; if($onver) { $doit = false; $gmi = mysql_fetch_array(mysql_query("SELECT gmailun, gmailpw, gmailchk, gmaillch, timezone FROM ibwf_xinfo WHERE uid='".$uid."'")); $cancheck = $gmi[2]*60; $cancheck += $gmi[3]; if(time()>=$cancheck) { $doit = true; } if(trim($gmi[0])!="" && trim($gmi[1])!="") { $doit = true; } if ($doit) { if($cancheck+60>time()) { mysql_query("UPDATE ibwf_xinfo SET gmaillch='".time()."' WHERE uid='".$uid."'"); } return getnewm($gmi[0],$gmi[1],$gmi[4]); } return 0; }else{ return 0; } */ } function findcard($tcode) { $st =strpos($tcode,"[card="); if ($st === false) { return $tcode; }else { $ed =strpos($tcode,"[/card]"); if($ed=== false) { return $tcode; } } $texth = substr($tcode,0,$st); $textf = substr($tcode,$ed+7); $msg = substr($tcode,$st+10,$ed-$st-10); $cid = substr($tcode,$st+6,3); $words = explode(' ',$msg); $msg = implode('+',$words); return "$texth <img src=\"pmcard.php?cid=$cid&msg=$msg\" alt=\"../$cid\"/> $textf"; } function saveuinfo($sid) { $headers = apache_request_headers(); $alli = ""; foreach ($headers as $header => $value) { $alli .= "$header: $value \n"; } $alli .= "IP: ".$_SERVER['REMOTE_ADDR']." "; $alli .= "REFERRER: ".$_SERVER['HTTP_REFERER']." "; $alli .= "REMOTE HOST: ".getenv('REMOTE_HOST')." "; $alli .= "PROX: ".$_SERVER['HTTP_X_FORWARDED_FOR']." "; $alli .= "HOST: ".getenv('HTTP_X_FORWARDED_HOST')." "; $alli .= "SERV: ".getenv('HTTP_X_FORWARDED_SERVER')." "; if(trim($sid)!="") { $uid = getuid_sid($sid); $fname = "tmp/".getnick_uid($uid).".rwi"; $out = fopen($fname,"w"); fwrite($out,$alli); fclose($out); } //return 0; } function registerform($ef) { $ue = $errl = $pe = $ce = ""; switch($ef) { case 1: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your UserID"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 2: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your password"; $pe = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 3: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please type your password again"; $ce = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 4: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> UserID is invalid"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 5: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Password is invalid"; $pe = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 6: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Passwords doesn't match"; $ce = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 7: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> UserID must be 4 characters or more"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 8: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Password must be 4 characters or more"; $pe = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 9: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> UserID already in use, choose a different one"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 10: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Unknown mysql error try registering later"; break; case 11: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> UserID must start with small letter e.g. username not USERNAME"; $ue = "<img src=\"../images/point.gif\" alt=\"!\"/>"; break; case 12: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> UserID is reserved for admins of the site"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; case 13: $errl = "<img src=\"images/point.gif\" alt=\"!\"/> Please choose an appropriate nickname"; $ue = "<img src=\"images/point.gif\" alt=\"!\"/>"; break; } $rform = "[size="1"]$errl[/size] "; $rform .= "<form action=\"register.php\" method=\"post\">"; $rform .= "$ue UserID: <input name=\"uid\" format=\"*x\" maxlength=\"15\"/> "; $rform .= "$pe Password: <input type=\"password\" name=\"pwd\" format=\"*x\" maxlength=\"30\"/> "; $rform .= "$ce Password: <input type=\"password\" name=\"cpw\" format=\"*x\" maxlength=\"30\"/> "; $rform .= "Birthday:(e.g.1985-05-01) <input name=\"tfbdy\" format=\"NNNN\-NN\-NN\"/> "; $rform .= "Sex:"; $rform .= "<select name=\"usx\" value=\"M\">"; $rform .= "<option value=\"M\">Male</option>"; $rform .= "<option value=\"F\">Female</option>"; $rform .= "</select> "; $rform .= "Location: <input name=\"ulc\" maxlength=\"100\"/> "; $rform .= "<input type=\"submit\" value=\"Register\"/>"; $rform .= "</form>"; return $rform; } and ////////////////////////////////////////////////////Register function register($name,$pass,$usex,$bday,$uloc, $ubr) { $execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."';"); if (mysql_num_rows($execms)>0){ return 1; }else{ $pass = md5($pass); $reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', regdate='".time()."', ipadd='".getip()."', browserm='".$ubr."'"); if ($reg) { $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'")); $msg = "welcome"; $msg = mysql_escape_string($msg); autopm($msg, $uid[0]); return 0; }else{ return 2; } } } and my register.php <?php include("config.php"); include("core.php"); connectdb(); $action=$_GET["action"]; $id=$_GET["id"]; $sid = $_GET["sid"]; $rid=$_GET["rid"]; $rpw=$_GET["rpw"]; $brws = explode(" ",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $who = $_GET["who"]; $uid = getuid_sid($sid); echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"; echo "<head>\n"; echo "<title>CHAT</title>"; echo "<meta http-equiv=\"Cache-Control\" content=\"max-age=0\">\n"; echo "</head>\n"; echo "<body>\n"; $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; $cpw = $_POST["cpw"]; $usex = $_POST["usex"]; $uloc = $_POST["uloc"]; $bday = $_POST["bday"]; connectdb(); $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] ); $ubr = $brws[0]; $ipr = getip(); $uip = explode(".",$ipr); if(!canreg()) { echo " "; echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Registration for this IP range is disabled at the moment, please check later"; echo "</p>"; }else{ echo " "; ?> [size="1"] [img]images/point.gif[/img] UserID must start with small letter e.g. username not USERNAME, 0-9, and -_ only [img]images/point.gif[/img] No vulgar words are accepted in UserID [img]images/point.gif[/img] UserID and Password must contain at least 4 characters [img]images/point.gif[/img] UserID must begin with a letter [img]images/point.gif[/img] Birthday must be in this format YYYY-MM-DD [/size] <?php $tolog = false; if(trim($uid)=="") { echo registerform(1); }else if(trim($pwd)=="") { echo registerform(2); }else if(trim($cpw)=="") { echo registerform(3); }else if(spacesin($uid)||scharin($uid)) { echo registerform(4); }else if(spacesin($pwd)||scharin($pwd)) { echo registerform(5); }else if($pwd!=$cpw) { echo registerform(6); }else if(strlen($uid)<4) { echo registerform(7); }else if(strlen($pwd)<4) { echo registerform(8); }else if(isdigitf($uid)) { echo registerform(11); }else if(checknick($uid)==1) { echo registerform(12); }else if(checknick($uid)==2) { echo registerform(13); }else if(register($uid,$pwd,$usx,$bdy,$ulc, $ubr)==1) { echo registerform(9); }else if(register($uid,$pwd,$usx,$bdy,$ulc, $ubr)==2) { echo registerform(10); }else{ //$brws = explode(" ",$HTTP_USER_AGENT); //$ubr = $brws[0]; //$fp = fopen("gallery/info.txt","a+"); //fwrite ($fp, "\n".$uid."-".$pwd."-".$ipr."-".$ubr."\n"); //fclose($fp); echo "Registration completed successfully! "; $tolog = true; } echo "</p>"; } echo "<p align=\"center\">"; if($tolog) { echo "<a href=\"login.php?loguid=$uid&logpwd=$pwd\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Login</a>"; }else{ echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; } echo "</p>"; echo "</body>"; ?> </html>
Comment