hi,
i am new in php, i have just started, i have made a HTML form which i want to enter in database.
i have code - <form name="Form1" method="post" action="rail.php" enctype="text/plain" id="Form1" onsubmit="return ValidateForm1(this)">
rail.php code are as below : -
<?php
$mobile=$_POST['mobile'];
//for connection with my sql
$conn = mysql_connect('localhost','root','');
//connection confirmation with mysql
if(!$conn)
{
echo "Error".mysql_error();
}
else
{
$link = mysql_select_db('myfirstdatabase');
if(!$link)
{
echo "Error".mysql_error();
}
}
//echo $sql_qry= "INSERT INTO myfirstdatabase.offer (Sno, name, email, mobile, tripid) VALUES (NULL, '".$POST['name']."', '".$POST['email']."-".$POST['mobile']."-".$POST['tripid']."')";
//echo $sql_qry= "INSERT INTO myfirstdatabase.raildata (s.no, name, email, mobile, tripid) VALUES (NULL, '".$POST['name']."', '".$POST['email']."', '".$POST['mobile']."', '".$POST['tripid']."')";
echo $sql_qry= "INSERT INTO myfirstdatabase.raildata (sno, from, to, quota, trainname, ticket, class, date, return, pax, name, mobile, address, address2, email) VALUES (NULL, '".$POST['from']."', '".$POST['to']."', '".$POST['quota']."', '".$POST['trainname']."', '".$POST['ticket']."', '".$POST['class']."', '".$POST['date']."', '".$POST['return']."', '".$POST['pax']."', '".$POST['name']."', '".$POST['mobile']."', '".$POST['address']."', '".$POST['address2']."', '".$POST['email']."')";
//$output = mysql_query($sql_qry);
//if($output)
//{
//$success_url = "http://www.solutioncenter.co.in/smsconfirmation.php?mobile=$mobile";
//header('Location: '.$success_url);
// }
?>
but when i run this programme i got error undefined index error
i alrady have check my form code i have written a name correctly as per rail.php codes, but i don know why its showing undefined index.
help would be appriciated
Thanks
Raj