Hello there, can anyone help me?
i want to put a restrictions in my application form.
for example, "Please complete all the fields"
and here's my code:
<?php
$posapp = $_POST['txtapplied'];
$fname = $_POST['txtfname'];
$mname = $_POST['txtmname'];
$lname = $_POST['txtlname'];
$month=$_POST['txtmonth'];
$day=$_POST['txtday'];
$year=$_POST['txtyear'];
$age=$_POST['txtage'];
$eadd=$_POST['txtemail'];
$homenumber=$_POST['txthnum'];
$cpnumber=$_POST['txtcpnumber'];
$address=$_POST['txtaddress'];
$religion=$_POST['txtreligion'];
$birthplace=$_POST['txtbplace'];
$height=$_POST['txtheight'];
$weight=$_POST['txtweight'];
$civilstatus=$_POST['txtcstatus'];
$college=$_POST['txtcollege'];
$course=$_POST['txtcourse'];
$yeargrad=$_POST['txtyeargrad'];
$db=mysql_connect('localhost','root','') or die ('Cannot connect to MYSQL!');
@mysql_select_db('dbriomra') or die('Cannot connect to database');
$query="INSERT INTO onlineapplication (positionapplied, firstname, middlename, lastname, month, day, year, age, emailaddress, homenumber, cellphone, address, religion, birthplace, height, weight, civilstatus, college, course, yeargrad) VALUES ('$posapp', '$fname', '$mname', '$lname', '$month', '$day', '$year', '$age', '$eadd', '$homenumber', '$cpnumber', '$address', '$religion', '$birthplace', '$height', '$weight', '$civilstatus', '$college', '$course', '$yeargrad')";
//$result = mysql_query($query);
if(mysql_query($query))
{
header('Location: oapp_finished.php');
}
else
{
echo "<br> Problem Loading";
}
mysql_close($db);
?>
Thanks