sql - How to remove this auto dot by php? -


i'm facing piculiar problem on site's registration form script. on date of birth field (1987-1-1) automaticall adding dot(.) on sql on phpmyadmin (1987-.01-.01) [n.b- month & date field contains dot]

my form action-

$rform .= "<form action=\"regagree.php\" method=\"post\">"; 

i'm using code on form

$rform .= "e-mail *<br/><input name=\"email\" maxlength=\"35\" size=\"10\"/><br/>"; $rform .= "birth date *<br/>";   $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=\"1999-\">";   $rform .= "<option value=\"1999-\">99</option>";   $rform .= "<option value=\"1998-\">98</option>";   $rform .= "<option value=\"1997-\">97</option>";   $rform .= "<option value=\"1996-\">96</option>";   $rform .= "<option value=\"1995-\">95</option>";   $rform .= "<option value=\"1994-\">94</option>";   $rform .= "<option value=\"1993-\">93</option>";   $rform .= "<option value=\"1992-\">92</option>";   $rform .= "<option value=\"1991-\">91</option>";   $rform .= "<option value=\"1990-\">90</option>";   $rform .= "<option value=\"1989-\">89</option>";   $rform .= "<option value=\"1988-\">88</option>";   $rform .= "<option value=\"1987-\">87</option>";   $rform .= "<option value=\"1986-\">86</option>";   $rform .= "<option value=\"1985-\">85</option>";   $rform .= "<option value=\"1984-\">84</option>";   $rform .= "<option value=\"1983-\">83</option>";   $rform .= "<option value=\"1982-\">82</option>";   $rform .= "<option value=\"1981-\">81</option>";   $rform .= "<option value=\"1980-\">80</option>";   $rform .= "<option value=\"1979-\">79</option>";   $rform .= "<option value=\"1978-\">78</option>";   $rform .= "<option value=\"1977-\">77</option>";   $rform .= "<option value=\"1976-\">76</option>";   $rform .= "<option value=\"1975-\">75</option>";   $rform .= "<option value=\"1974-\">74</option>";   $rform .= "<option value=\"1973-\">73</option>";   $rform .= "<option value=\"1972-\">72</option>";   $rform .= "<option value=\"1971-\">71</option>";   $rform .= "<option value=\"1970-\">70</option>";   $rform .= "<option value=\"1979-\">79</option>";   $rform .= "<option value=\"1978-\">78</option>";   $rform .= "<option value=\"1977-\">77</option>";   $rform .= "<option value=\"1976-\">76</option>";   $rform .= "<option value=\"1975-\">75</option>";   $rform .= "<option value=\"1974-\">74</option>";   $rform .= "<option value=\"1973-\">73</option>";   $rform .= "<option value=\"1972-\">72</option>";   $rform .= "<option value=\"1971-\">71</option>";   $rform .= "<option value=\"1970-\">70</option>";   $rform .= "<option value=\"1969-\">69</option>";   $rform .= "<option value=\"1968-\">68</option>";   $rform .= "<option value=\"1967-\">67</option>";   $rform .= "<option value=\"1966-\">66</option>";   $rform .= "</select><br/>"; 

if needed it'll post regagree.php (please ask)

although i've checked several time can't find out problem is.

here regagree.php

<?php include("inc/func.inc.php"); header("expires: mon, 26 jul 1997 05:00:00 gmt"); header("last-modified: " . gmdate("d, d m y h:i:s") . " gmt"); header("cache-control: no-cache, must-revalidate"); header("pragma: no-cache"); echo "<?xml version=\"1.0\"?>\n"; echo "<!doctype html public \"-//wapforum//dtd xhtml mobile 1.0//en\" \"http://www.wapforum.org/dtd/xhtml-mobile10.dtd\">\n"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <?php    if(!db()){   echo "<head>";   echo "<title>bdteens - desi wap community !</title>";   include("inc/css.inc.php");   echo "</head>";   echo "<body>";   echo getdberror();   echo "</body>";   echo "</html>";   exit();   }  $uid = $_post["uid"];  $pwd = $_post["pwd"];  $state = $_post["state"];  $status = $_post["status"];  $cpw = $_post["cpw"];  $usx = $_post['usx'];  $day = $_post['day'];  $loc = $_post['loc'];  $month = $_post['month'];  $year = $_post['year'];  $info = $_post['info'];  $email = $_post["email"];  $refer = $_post["refer"];  $captcha = $_post["captcha"];  $ubr = $_server['http_user_agent'];  $uip = getip();  $nomon = $_server['http_x_fh_msisdn'];  $nomtw = $_server['http_msisdn'];  $nomtr = $_server['http_x_up_calling_line_id'];  $nomon2 = $http_x_fh_msisdn;  $nomtw2 = $http_msisdn;  $nomtr2 = $http_x_up_calling_line_id;   if($nomon != "")  {  $numberp = $nomon;  }else  if($nomtw != "")  {  $numberp = $nomtw;   }else  if($nomtr != "")  {  $numberp = $nomtr;   }else if($nomon2 != "")  {  $numberp = $nomon2;   }else if($nomtw2 != "")  {  $numberp = $nomtw2;   }else  if($nomtr2 != "")  {  $numberp = $nomtr2;  }           echo "<head>";   echo "<title>bdteens - desi wap community !</title>";   include("inc/css.inc.php");  echo "</head>";  echo "<body>";  echo "<div class=\"box_cen\">";  echo "<b>registration</b>";   if(!canreg()) {   echo "<div class=\"box_sub\" align=\"center\">";     echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>sorry.. registration closed. please try later."; }else{   $tolog = false;   if(trim($uid)=="")  {     echo registerform(1);  }else if(trim($pwd)=="")  {     echo registerform(2);  }else if(trim($cpw)=="")  {     echo registerform(3); }else if((regchars($uid))||(nospace($uid))||(checknumber($uid))) {     echo registerform(4); }else if((regchars($pwd))||(nospace($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(nameexist($uid)==true) {     echo registerform(9);  }else if(trim($email)=="") {     echo registerform(10); }else if(checkemail($email)==false) {     echo registerform(11); }else if(emailexist($email)==true) {     echo registerform(12); }else if($captcha!=$_session["captcha_code"]) {     echo registerform(13); }else if(register($uid, $pwd, $usx, $day, $month, $year, $loc, $email, $info, $state, $status, $refer, $ubr, $uip, $numberp)==1) {     echo registerform(14); }else if(register($uid, $pwd, $usx, $day, $month, $year, $loc, $email, $info, $state, $status, $refer, $ubr, $uip, $numberp)==2) {     echo registerform(14); }else{   echo "<div class=\"box_sub\" align=\"left\">";   echo "<center>registration completed successfully!</center><br/><hr>";  echo "<i><b>username:</b> $uid</i><br/>";  echo "<i><b>password:</b> *****</i><br/>";  echo "<i><b>e-mail:</b> $email</i><br/><hr>";  $tolog = true; } }  if($tolog) {  $pmtext = "thank joining @ bdteens, registration detail. \n\n username: $uid \n password: $pwd";   $from_head = "from: admin@bdteens";   $subject = "bdteens sign-up detail";   $time = time();   $ddt = date("m d y", $time);   $content = "date: $ddt \n\n $pmtext \n\n bdteens best wap community! \n\n http://bdteens";   mail($email, $subject, $content, $from_head);     echo "<a href=\"login.php?loguid=$uid&amp;logpwd=$pwd\">";  echo "login now</a>"; echo "</div>";  echo "</div>"; echo footerweb($hits); }else{  echo "</div>"; echo footerweb($hits); } echo "</body>"; ?>  </html> 

here register.php

<?php include("inc/func.inc.php"); header("expires: mon, 26 jul 1997 05:00:00 gmt"); header("last-modified: " . gmdate("d, d m y h:i:s") . " gmt"); header("cache-control: no-cache, must-revalidate"); header("pragma: no-cache"); echo "<?xml version=\"1.0\"?>\n"; echo "<!doctype html public \"-//wapforum//dtd xhtml mobile 1.0//en\" \"http://www.wapforum.org/dtd/xhtml-mobile10.dtd\">\n"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <?php   if(!db()){   echo "<head>";   echo "<title>bdteens - desi wap community !</title>";   include("inc/css.inc.php");   echo "</head>";   echo "<body>";   echo getdberror();   echo "</body>";   echo "</html>";   exit();   }           echo "<head>";   echo "<title>bdteens - desi wap community !</title>";   include("inc/css.inc.php");  echo "</head>";  echo "<body>";  echo "<div class=\"box_cen\" align=\"center\">";  echo "<b>registration</b>";  if(!canreg()) {   echo "<div class=\"box_sub\" align=\"center\">";     echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>sorry.. registration closed. please try later.";     echo "</div>";  echo "</div>";  echo footerweb($hits); }else{   echo "<div class=\"box_sub\" align=\"left\">";   echo "<b>confirmation registrations</b><br/>";   echo "<b>*</b> allowed characters in username , password a-z, a-z, 0-9, , -_ only<br/>";   echo "<b>*</b> no vulgar words accepted in username<br/>";   echo "<b>*</b> username must contain @ least 4 characters<br/>";   echo "<b>*</b> please insert real e-mail easy missing password<br/>";   echo "<b>*</b> if browser can't view security question, try refreshing sites , try again<br/>";   echo "<b>*</b> id deleted automatic if not active in 3 months<br/>";   echo "<b>*</b> must follow our rules before join wap<br/>";     echo "<br/>";  echo "<center><a href=\"regagree.php\">i agree</a> / <a href=\"index.php\">i disagree</a></center></div>";  echo "</div>"; echo footerweb($hits);  }  echo "</body>"; ?> </html> 

you can use string functions:

$date = '(1987-.01-.01)';  str_replace('.', '' , $date); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -