Hello every one,
i have a form with drop down list of month,dates,year. and text fields. i am able to insert the text fields values fine, but could not insert values from the dropdownlist(month,date,year) using same method. please could someone help me.below is my code.
<?php
session_start();session_destroy();
session_start();
if($_GET["firstname"] && $_GET["lastname"] && $_GET["email"] ["password"] && $_GET["repassword"])
{
if($_GET["password"]==$_GET["repassword"])
{
$servername="";
$username="";
$password="";
$conn= mysql_connect($servername,$username,$password)or die(mysql_error());
mysql_select_db("m",$conn);
$firstname = mysql_real_escape_string( stripslashes( $_POST[ 'firstname' ] ) );
$lastname = mysql_real_escape_string( stripslashes( $_POST[ 'lastname' ] ) );
$email = mysql_real_escape_string( stripslashes( $_POST[ 'email' ] ) );
$password = mysql_real_escape_string( stripslashes( $_POST[ 'passowrd' ] ) );
$address = mysql_real_escape_string( stripslashes( $_POST[ 'address' ] ) );
$month = mysql_real_escape_string( stripslashes( $_POST[ 'month' ] ) );
$date = mysql_real_escape_string( stripslashes( $_POST[ 'date' ] ) );
$year = mysql_real_escape_string( stripslashes( $_POST[ 'year' ] ) );
$sql="insert into datas (firstname,lastname,email,password,address,month,date,year)values('$_GET[firstname]','$_GET[lastname]','$_GET[email]','$_GET[password]','$_GET[address]','$_GET[month]','$_GET[date]','$_GET[year]')";
$result=mysql_query($sql,$conn) or die(mysql_error());
print "<h1>you have registered sucessfully</h1>";
print "<a href='index.php'>go to login page</a>";
}
else print "passwords doesnt match";
}
else print"invaild input data";
?>