riyazbasha Posted February 4, 2010 Share Posted February 4, 2010 pls let me know how to insert these register form details in mysql database.(Myphpadmin).firstname,lastname,username,password,confirm password,email,confirm email,date of birth,gender,address,state,country. These r register form details,i have created fields also in myphpadmin.My problem is when user will register in this form,how data goes in my database field.pls let me know.regardsriyaz. <html><title>registerform</title><script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script><script type="text/javascript"><!--function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');} }//--></script><style type="text/css"><!--body { background-image: url(images/bg_16.gif); color: #F00; font-size: 18px;}--></style><link href="register_css.htm" rel="stylesheet" type="text/css"><link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css"><form name="form1" method="post" action=""> <blockquote onClick="MM_validateForm('firstname','','R');return document.MM_returnValue"> <blockquote> <blockquote> <blockquote> <blockquote> <p> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> <p> </p> <p> </p> <table width="50%" border="6" align="center" cellpadding="4" cellspacing="20" id="register.form"> <tr> <td align="right" bgcolor="#33FFFF">Firstname:</td> <th align="left" bgcolor="#33FFFF"><input name="firstname" type="text" id="firstname" maxlength="50"></th> </tr> <tr> <td align="right" bgcolor="#33FFFF">Lastname:</td> <td align="left" bgcolor="#33FFFF"><input name="lastname" type="text" id="lastname" maxlength="50"></td> </tr> <tr class="username"> <td align="right" bgcolor="#33FFFF"><label for="username">Username:</label></td> <td align="left" bgcolor="#33FFFF" class="username"><input name="username" type="text" id="username" maxlength="50"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="password">Password:</label></td> <td align="left" bgcolor="#33FFFF"><input name="password" type="password" id="password" maxlength="50"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="confirmpassword">Confirm Password:</label></td> <td align="left" bgcolor="#33FFFF"><span id="spryconfirm1"> <input name="confirmpassword" type="password" id="confirmpassword" maxlength="50"> <span class="confirmRequiredMsg">A value is required.</span><span class="confirmInvalidMsg">The values don't match.</span></span></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="email">Email:</label></td> <td align="left" bgcolor="#33FFFF"><input type="text" name="email" id="email"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="confirmemail">Confirm Email:</label></td> <td align="left" bgcolor="#33FFFF"><span id="spryconfirm2"> <input type="text" name="confirmemail" id="confirmemail"> <span class="confirmInvalidMsg">The values don't match.</span><span class="confirmRequiredMsg">A value is required.</span></span></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="dateofbirth">Date of Birth:</label></td> <td align="left" bgcolor="#33FFFF"><input type="text" name="dateofbirth" id="dateofbirth"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="gender">Gender:</label></td> <td align="left" bgcolor="#33FFFF"><select name="gender" id="gender"> <option SELECTED >-select-</option> <option value="m">Male</option> <option value="f">Female</option> </select></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="address"> Address:</label></td> <td align="left" bgcolor="#33FFFF"><p> <label for="textfield"></label> <input type="text" name="address" id="address"> </p></td> </tr> <tr> <td align="right" bgcolor="#33FFFF"><label for="pincode">Pincode:</label></td> <td align="left" bgcolor="#33FFFF"><input type="text" name="pincode" id="pincode"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF">State:</td> <td align="left" bgcolor="#33FFFF"><input type="text" name="state" id="state"></td> </tr> <tr> <td align="right" bgcolor="#33FFFF">Country:</td> <td align="left" bgcolor="#33FFFF"><input type="text" name="counrty" id="counrty"></td> </tr> </table><p> </p> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> <a href="registered.php"> <input name="submit" type="submit" id="submit" onClick="MM_validateForm('firstname','','R','lastname','','R','username','','R','password','','R','confirmpassword','','R','email','','RisEmail','confirmemail','','RisEmail','dateofbirth','','R','address','','R','pincode','','RisNum','state','','R','counrty','','R');return document.MM_returnValue" value="register"> </a> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote></form><script type="text/javascript"><!--var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "password", {validateOn:["blur"]});var spryconfirm2 = new Spry.Widget.ValidationConfirm("spryconfirm2", "email", {validateOn:["blur"]});//--></script></html> Link to comment Share on other sites More sharing options...
justsomeguy Posted February 4, 2010 Share Posted February 4, 2010 What the heck is the thinking behind using all those nested blockquote elements? Whatever you're trying to accomplish there, there's a better way.Look into INSERT statements in general:http://www.w3schools.com/sql/sql_insert.aspMore information about how PHP interacts with MySQL specifically:http://www.w3schools.com/php/php_mysql_intro.aspYour page is also missing HTML head and body elements... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.