Hi guys,
i'm new to php.
i have designed only one php page for whole website using sections.
And in each section i have button,
now how can i use form action for each button to call
specific php page, on button click.
Php Insertion Code:
<form action="InsertInterview.php" method="post">
insertinterview.php code:
<?php
include Conn.php;
if(!$conn)
{
die('Could not connect to the server!');
}
else{
$sql = 'INSERT INTO Interview'.
'(
Employer_EmailID,
Job_Position,
Message,
InterviewDate,
InterviewTime,
Location,
InsertionDate)'.
' VALUES ('.
$_POST['iemail'].','.
$_POST['iposition'].','.
$_POST['imessage'].','.
$_POST['idate'].','.
$_POST['itime'].','.
$_POST['ilocaiton'].','.
$_POST['iemail'].','.
')';
$retval = mysql_query($sql, $conn);
$msg;
if(!$retval)
{
die('Count enter data. ' . mysql_error);
$msg = mysql_error;
}
else{
$msg = 'Data Entered Successfully!';
}
echo $msg;
mysql_close($conn);
}
?>
I have created InsertInterview.php to insert into mysql and calling this page in form action, but i have one more button for contact me, then for contact me page, how to call its particular page in form action.
Currently i'm not able to insert records into the mysql database.
can any one please help me.
Thanks