cannot insert into mysql:data
i have problem
problem:
when i try to insert usinga html form
it inserts a new record but no data is inserted.
code for html form:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>::beebaho.com::</title>
</head>
<body topmargin="0">
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#D7E1EC" width="772" height="155">
<tr>
<td width="770" height="1" valign="top">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/banner2.jpg" width="770" height="39"></td>
</tr>
<tr>
<td width="770" height="1" valign="top" background="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/pg_topdecoration.gif"> </td>
</tr>
<tr>
<td width="770" height="18" valign="top">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" height="19">
<tr>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">
Home</td>
<td width="11%" bgcolor="#B4C8DC" height="19">
<p align="center">Planning</td>
<td width="9%" bgcolor="#B4C8DC" height="19">
<p align="center">Support</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Privacy</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Bride</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Groom</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Events</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Dating</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">
Advertise</td>
<td width="10%" bgcolor="#B4C8DC" height="19">
<p align="center">Terms</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="770" height="234" valign="bottom" bgcolor="#EAEFF4">
<p align="left"> & nbsp;
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="101%" height="17">
<tr>
<td width="1%" valign="top" height="16" bgcolor="#EAEFF4">
<p align="center"> </td>
<td width="33%" valign="top" height="16" colspan="2" bgcolor="#EAEFF4"> </td>
<td width="66%" valign="top" height="16" colspan="5" bgcolor="#EAEFF4">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/motto2.jpg" align="left" width="302" height="24"></td>
</tr>
<tr>
<td width="2%" valign="top" height="155" rowspan="6" bgcolor="#EAEFF4"> <p> </p>
<p align="center"> </td>
<td width="26%" valign="top" height="155" rowspan="6" bgcolor="#D7E1EC">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/registration.jpg" width="255" height="39"><p>
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/ragist_graphic.jpg" width="255" height="84"></p>
<p align="left"> Already Registered ?
Login</td>
<td width="1%" height="155" rowspan="6" background="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/dot2.jpg"> </td>
<td width="2%" height="155" rowspan="6" bgcolor="#D7E1EC"> </td>
<td width="50%" height="59" bgcolor="#D7E1EC"> </td>
<td width="15%" height="155" rowspan="6" bgcolor="#D7E1EC" background="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/cell_bg2.jpg">
<p align="center"> </td>
<td width="2%" height="155" rowspan="6" bgcolor="#EAEFF4"> </td>
<td width="2%" height="155" rowspan="6"> </td>
</tr>
<tr>
<td width="50%" height="14" bgcolor="#D7E1EC"><i>
The beebaho.com
Advantage :</i></td>
</tr>
<tr>
<td width="50%" height="24" bgcolor="#D7E1EC">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/square1.gif" width="3" height="3">
High
Authenticity-
Access
Screened profile</td>
</tr>
<tr>
<td width="50%" height="22" bgcolor="#D7E1EC">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/square1.gif" width="3" height="3">
Total
Privacy-
Control
visibility of your photos</td>
</tr>
<tr>
<td width="50%" height="23" bgcolor="#D7E1EC">
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/square1.gif" width="3" height="3">
beebaho.com exclusive-Exclusive
features on every item</td>
</tr>
<tr>
<td width="50%" height="7" bgcolor="#D7E1EC"> </td>
</tr>
<tr>
<td width="100%" valign="top" height="17" colspan="8" bgcolor="#EAEFF4"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="770" height="111" valign="bottom" bgcolor="#D7E1EC">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="74">
<tr>
<td width="1%" bgcolor="#EAEFF4" rowspan="14" height="1"> </td>
<td width="98%" bgcolor="#B4C8DC" colspan="6" height="19">
<p align="center">
Note: All fields are compulsory. Please enter accurate
information in this form or your profile may be declined.
</td>
<td width="1%" bgcolor="#EAEFF4" rowspan="14" height="1"> </td>
</tr>
<tr>
<td width="98%" height="19" colspan="6"> &n bsp;
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/underline.jpg" width="600" height="13"></td>
</tr>
<form name="beereg1" action="insertReg2.php?" method="post">
<tr>
<td width="19%" height="19">
Profile created by</td>
<td width="1%" height="19"> </td>
<td width="31%" height="19" colspan="3">
<select name="ddrelationship" class="formselect" style="font-family: Verdana; font-size: 9px" tabindex="0"><option value="">Select</option><option>Self</option><option>Parent / Guardian</option><option>Sibling</option><option>Friend</option><option>Other</option></select></td>
<td width="47%" height="43" rowspan="3">
Profile ID must have minimum 4 characters & no special characters. It cannot be changed later. <br>
You will be known on the site by this name, e.g. a Profile with ID 'Anand' will be seen as Anand's profile.</td>
</tr>
<tr>
<td width="9%" height="19"> </td>
<td width="17%" height="19"> </td>
<td width="5%" height="19"> </td>
</tr>
<tr>
<td width="19%" height="5">
Profile ID </td>
<td width="1%" height="5"></td>
<td width="31%" height="5" colspan="3">
<input name="txtProfile" value="" class="forminput" type="text" size="20" tabindex="1"></td>
</tr>
<tr>
<td width="19%" height="19">
Email &nb sp; </td>
<td width="1%" height="19"> </td>
<td width="31%" height="19" colspan="3">
<input name="txtEmail" value="" class="forminput" size="30" type="text" tabindex="2" Onblur="chkmail()"></td>
<td width="47%" height="16" rowspan="2">
Please enter your email correctly. You will be logging in using this email. We will send you member responses here.</td>
</tr>
<tr>
<td width="19%" height="1"></td>
<td width="1%" height="1"></td>
<td width="9%" height="1"></td>
<td width="17%" height="1"></td>
<td width="5%" height="1"></td>
</tr>
<tr>
<td width="19%" height="27">
Confirm Email</td>
<td width="1%" height="27"> </td>
<td width="31%" height="27" colspan="3">
<input name="email2" value="" class="forminput" size="30" type="text" tabindex="3"></td>
</tr>
<tr>
<td width="98%" height="19" colspan="6"> &n bsp;
<img border="0" src="../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/beebaho.com/final%20site/images/underline.jpg" width="600" height="13"></td>
</tr>
<tr>
<td width="19%" height="30">
Password</td>
<td width="1%" height="30"> </td>
<td width="31%" height="30" colspan="3">
<input name="txtPass" value="" class="forminput" type="password" size="20" tabindex="4"></td>
<td width="47%" height="30">
min 10 char,no special characters</td>
</tr>
<tr>
<td width="19%" height="36"> confirm
password </td>
<td width="1%" height="36"> </td>
<td width="31%" height="36" colspan="3">
<input name="password2" value="" class="forminput" type="password" size="20" tabindex="5"></td>
<td width="47%" height="36">
enter exactly same above password</td>
</tr>
<tr>
<td width="17%" height="1"> Gender</td>
<td width="1" height="1"> <p> </td>
<td width="31%" height="1" colspan="3">
<input type="radio" value="V3" checked name="R1" tabindex="6"> male &nbs p;
<input type="radio" name="R1" value="V4" tabindex="7">female </td>
<td width="47%" height="1">
</td>
</tr>
<tr>
<td width="19%" height="24"> Date
of birth </td>
<td width="1%" height="24"> </td>
<td width="31%" height="24" colspan="3">
<select size="1" name="D1" tabindex="8">
<option>Day</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>01</option>
</select>
<select size="1" name="D2" tabindex="9">
<option>Month</option>
<option>Januarary</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
<select size="1" name="D3" tabindex="10">
<option>Year</option>
<option>1961</option>
<option>1962</option>
<option>1963</option>
<option>1964</option>
<option>1970</option>
<option>1971</option>
<option>1972</option>
<option>1973</option>
<option>1974</option>
<option>1975</option>
<option>1975</option>
<option>1976</option>
<option>1977</option>
<option>1978</option>
<option>1979</option>
<option>1979</option>
<option>1980</option>
<option>1981</option>
<option>1982</option>
<option>1983</option>
<option>1984</option>
<option>1985</option>
<option>1986</option>
<option>1935</option>
<option>1936</option>
<option>1937</option>
<option>1938</option>
<option>1939</option>
<option>1940</option>
<option>1941</option>
<option>1942</option>
<option>1941</option>
<option>1942</option>
</select> </td>
<td width="47%" height="24">
enter date of birth dd/mm/yyyy</td>
</tr>
<tr>
<td width="19%" height="25">
Religion</td>
<td width="1%" height="25"> </td>
<td width="31%" height="25" colspan="3">
<select size="1" name="Relg1" tabindex="11">
<option selected>Religion</option>
<option value="Muslim">Muslim</option>
<option value="Muslim|Dhaka">-Dhaka</option>
<option value="Muslim|Syhleti">-Syhleti</option>
<option value="Muslim|Chittagongi">-Chittagongi</option>
<option value="Muslim|Rajshahi">-Rajshahi</option>
<option value="Muslim|Tangaili">-Tangail</option>
</select></td>
<td width="47%" height="25">
min 10 char,no special characters</td>
</tr>
<script language="JavaScript">
function valDt()
{
if(document.beereg1.txtProfile.value=="")
{
alert("Enter Profile Name");
document.beereg1.profile.focus();
return;
}
else if(document.beereg1.txtEmail.value=="")
{
alert("Enter email")
document.beereg1.contactp.focus();
return;
}
else if(document.beereg1.email2.value=="")
{
alert("retype email")
document.beereg1.email2.focus();
return;
}
}
function chkmail()
{
var mail1=new String("");
var mail1=document.beereg1.txtEmail.value;
//var chkmStr=new String("yahoomail");
var cont=/\@/;
var dot=/\./;
var str2=mail1.search(cont);
var str3=mail1.search(dot);
if(str2==-1|| str3==-1){
alert("enter correct email address")
document.beereg1.txtEmail.value="";
return;
}else{
document.close();
}
}
//else if((document.beereg1.category.options[document.beereg1.category.selectedIndex].value!="select") && (document.beereg1.scategory.value!=""))
//{
//alert("Either Select/Suggest a Category.");
//document.beereg1.scategory.focus();
//document.beereg1.scategory.select();
//return ;
//}
//else
//{
//document.beereg1.submit();
//return;
//}
//}
</script>
<tr>
<td width="1%" bgcolor="#EAEFF4" height="24"> </td>
<td width="19%" height="33">
Country Of residence</td>
<td width="1%" height="30"> </td>
<td width="31%" height="30" colspan="3">
<select size="1" name="resC" tabindex="12">
<option>Country</option>
<option>Bangladesh</option>
<option>India</option>
<option>Pakistan</option>
</select></td>
<td width="47%" height="30">
</td>
<td width="1%" bgcolor="#EAEFF4" height="24"> </td>
</tr>
<tr>
<td width="1%" bgcolor="#EAEFF4" height="11"> </td>
<td width="98%" height="36" colspan="6" rowspan="2">
&n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p;
<input type="submit" value="" name="B1" style="width: 80; height: 25; background-image: url('../../../../../../Personal/floppy/WEBsiteDEV/BeeBaho.com/shaadi/reg_files/continue.gif'); background-repeat:no-repeat; background-attachment:fixed" Onclick='valDt()'></td>
<td width="1%" bgcolor="#EAEFF4" height="11"> </td>
</tr>
</form>
<tr>
<td width="1%" bgcolor="#EAEFF4" height="13"> </td>
<td width="1%" bgcolor="#EAEFF4" height="13"> </td>
</tr>
<?php
?>
</html>
code for insert
<?php
require("beebahomain.php");
$post=$HTTP_VARS_POST["ddrelationship"];
$UserN= $HTTP_GET_POST["txtProfile"];
$email=$HTTP_VARS_POST["txtEmail"];
$pass1=$HTTP_VARS_POST["txtPass"];
// $gen=$HTTP_VARS_POST["R1"];
$Yr=$HTTP_VARS_POST["yr"];
$Mon=$HTTP_VARS_POST["month"];
$D1=$HTTP_VARS_POST["Day1"];
$relg=$HTTP_VARS_POST["Relg1"];
$ResCnt=$HTTP_VARS_POST["resC"];
class insertReg2 extends beebaho
{
function Con($db)
{
beebaho::Connect();
MYSQL_SELECT_DB("$db");
global $pass1;
echo $pass1;
}
function GenID($link,$query)
{
global $ID,$ID2,$result,$row,$link,$query,$num1,$ResCnt;
$result=mysql_query("SELECT id FROM bbhcan1 ");
$num1=mysql_num_rows($result);
// echo $num1;
$num1=$num1+1;
$d="Usr";
$USERID=$d.$num1;
//echo $USERID;
}
function getD()
{
global $Yr,$Mon,$D1;
$date=$Yr.$Mon.$D1;
echo $date;
}
function insert($link,$query)
{
global $USERID,$post,$UserN,$email,$pass1,$gen1,$date1,$r elg,$num1,$ResCnt;
$query ="INSERT into bbhcan1(profC,profN,email,password,relg,countR) VALUES('$post','$UserN','$email','$pass1','$relg', '$ResCnt')";
//$query1="INSERT into canddetails(AccNo) Values('$Act')";
mysql_query($query,$link)
or die("Could'nt add data to table".mysql_error());
mysql_close($link);
}
}
$InREG=new insertReg2();
$InREG->Con($db);
//$InREG->GenID($link,$query);
//$InREG->getD();
$InREG->insert($link,$query);
?>
Prob:
i maen everything is ok
id is autoincremented meanining
there is insertation but no data is inserted from form(html)
The impossible does not exist
|