barnes Posted May 1, 2007 Share Posted May 1, 2007 register.html <body> <form action="register.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table width="410" border="0" align="center" bordercolor="#99FFFF"> <tr align="center" valign="middle"> <td colspan="3"> <span class="style1">User Registration</span> </td> </tr> <tr> <td width="156" align="left"><div align="right" class="style4">UserName</div></td> <td width="22">:</td> <td width="218"><div align="left"> <input name="username" type="text" name="username" /> </div></td> </tr> <tr> <td><div align="right" class="style4">Password</div></td> <td>:</td> <td><label> <div align="left"> <input name="passwrod" type="password" name="passwrod" /> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">E mail</div></td> <td>:</td> <td><label> <div align="left"> <input type="text" name="email" /> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">Address</div></td> <td>:</td> <td><label> <div align="left"> <textarea name="address"></textarea> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">Country</div></td> <td>:</td> <td><label> <div align="left"> <select name="country"> <option>india</option> <option>usa</option> <option>pak</option> <option>england</option> <option>aus</option> <option>newzeland</option> <option>rsa</option> <option>srilanka</option> <option>west indies</option> </select> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">City/Area</div></td> <td>:</td> <td><label> <div align="left"> <select name="area" size="1" multiple="multiple" id="area"> </select> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">Pin Code </div></td> <td>:</td> <td><label> <div align="left"> <input name="pin" type="text" id="pin" /> </div> </label></td> </tr> <tr> <td><div align="right" class="style4">Phone Number </div></td> <td>:</td> <td><label> <div align="left"> <input name="counrtycode" type="text" id="counrtycode" size="3" maxlength="3" /> <input name="phoneno" type="text" id="phoneno" /> </div> </label></td> </tr> <tr> <td><div align="left" class="style4"> <div align="right">Upload Your Photo </div> </div></td> <td><div align="left">:</div></td> <td><label> <div align="left"> <input type="file" name="file" /> </div> </label></td> </tr> <tr> <td colspan="3"><label> <div align="center"> <input type="submit" name="Submit" value="Submit" /> </div> </label></td> </tr> </table> </form> </body> register.php <?php $con=mysql_connect("localhost","root",""); mysql_select_db("user",$con); $username = $_post[username]; $password = $_post[password]; $email = $_post; $add = $_post[address]; $contry=$_post[country]; $area=$_post[area]; $pin=$_post[pin]; $countrycode=$_post[countrycode]; $phoneno=$_post[phoneno]; $file=$_post[file]; $qry="INSERT INTO user1 (username,password,email,address,country,area,pincode,countrycode,phoneno,file) VALUES ('$username','$password','$email','$add','$contry','$area','$pin','$countrycode','$phoneno','$file')"; mysql_query($qry,$con); mysql_close($con); ?> the following errors occured.how to fix these bugs. Notice: Use of undefined constant username - assumed 'username' in c:\easyphp1-8\www\register.php on line 10 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 10 Notice: Use of undefined constant password - assumed 'password' in c:\easyphp1-8\www\register.php on line 11 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 11 Notice: Use of undefined constant email - assumed 'email' in c:\easyphp1-8\www\register.php on line 12 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 12 Notice: Use of undefined constant address - assumed 'address' in c:\easyphp1-8\www\register.php on line 13 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 13 Notice: Use of undefined constant country - assumed 'country' in c:\easyphp1-8\www\register.php on line 14 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 14 Notice: Use of undefined constant area - assumed 'area' in c:\easyphp1-8\www\register.php on line 15 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 15 Notice: Use of undefined constant pin - assumed 'pin' in c:\easyphp1-8\www\register.php on line 16 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 16 Notice: Use of undefined constant countrycode - assumed 'countrycode' in c:\easyphp1-8\www\register.php on line 17 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 17 Notice: Use of undefined constant phoneno - assumed 'phoneno' in c:\easyphp1-8\www\register.php on line 18 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 18 Notice: Use of undefined constant file - assumed 'file' in c:\easyphp1-8\www\register.php on line 19 Notice: Undefined variable: _post in c:\easyphp1-8\www\register.php on line 19 Link to comment https://forums.phpfreaks.com/topic/49399-little-help-in-coding/ Share on other sites More sharing options...
DaveEverFade Posted May 1, 2007 Share Posted May 1, 2007 change all your $_post to $_POST They are case sensitive and need to be in capitols Dave Link to comment https://forums.phpfreaks.com/topic/49399-little-help-in-coding/#findComment-242131 Share on other sites More sharing options...
jitesh Posted May 1, 2007 Share Posted May 1, 2007 <?php $con=mysql_connect("localhost","root",""); mysql_select_db("user",$con); $username = (isset($_POST[username]))?$_POST[username]:""; ................. ................... or <?php error_reporting(0); $con=mysql_connect("localhost","root",""); mysql_select_db("user",$con); Link to comment https://forums.phpfreaks.com/topic/49399-little-help-in-coding/#findComment-242133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.