Create a Web site for tracking, documenting, and managing the process of intervi
ID: 3912728 • Letter: C
Question
Create a Web site for tracking, documenting, and managing the process of interviewing candidates for professional positions. On the main page, include a form with fields for the interviewer’s name, position, and date of interview. Also include fields for entering the candidate’s name, communication abilities, computer skills, business knowledge, and interviewer’s comments. Clicking the Submit button should save the data in a MySQL database. Include a link for opening a document that displays each candidate’s interview information. Save the document as interviews.php. Open the interviews.php page a Web browser to test. Can anyone answer this, as the answers given aren't accurate.
Here is what I currently have:
interview.php
<html>
<head><title>interview program</title></head>
<body>
<center>Interviewing Candidates for Professional Positions</center>
<form action="candidate.php" method="post">
<table>
<tr><td><label>Interviewer’s name:</label></td>
<td><input type="text" name="iname"/></td>
</tr>
<tr><td><label>Position:</label></td>
<td><input type="text" name="pos"/></td>
</tr>
<tr><td><label>Date of interview:</label></td>
<td><input type="text" name="dofin"/></td>
</tr>
<tr><td><label>Candidate's Name:</label></td>
<td><input type="text" name="cdname"/></td>
</tr>
<tr><td><label>Communication Abilities:</label></td>
<td><input type="text" name="cabilities"/></td>
</tr>
<tr><td><label>Professionlal Apperance:</label></td>
<td><input type="text" name="papp"/></td>
</tr>
<tr><td><label>Computer Skills:</label></td>
<td><input type="text" name="Compskill"/></td>
</tr>
<tr><td><label>Business Knowldge:</label></td>
<td><input type="text" name="bkno"/></td>
</tr>
<tr><td><label>Interviewer’s Comment:</label></td>
<td><input type="text" name="icomm"/></td>
</tr>
<tr><td><input type="submit" value="submit"/></td>
</tr>
</table>
</form>
</center>
</body>
</html>
candidate.php
<?php
$interviewer_name=$_POST['iname'];
$position=$_POST['pos'];
$date_of_interview=$_POST['dofin'];
$candidates_name=$_POST['cdname'];
$communicationab=$_POST['cabilities'];
$professionalap=$_POST['papp'];
$compskills=$_POST['compskill'];
$businessknd=$_POST['bkno'];
$inter_comment=$_POST['icomm'];
$dbc=mysql_connect("localhost","root","AidanCT11") or die("mysql_error()");
mysql_select_db("regisdb")or die("mysql_error()");
mysqli_query($connect,"INSERT INTO candidate(iname,pos,dofin,cdname,cabilities,papp,compskill,bkno,icomm)
VALUES
('$interviewer_name','$position','$date_of_interview','$candidates_name','$communicationab','$professionalap','$compskills','$businessknd','$inter_co
mment')");
if(mysqli_affected_rows($connect) > 0){
echo "<p>One record Added</p>";
echo "<a href="interview.html">Go Back</a>";
} else {
echo "No records added<br />";
echo mysqli_error ($connect);
}
?><html>
<head><title>Details</title>
</head>
<body>
Thank u for submitting the details.The information has been saved.Click <a href="demo.php">here </a> to check the details
</body>
</html>
demo.php
<html>
<head><title>information</title>
</head>
<body>
<?php
$interviewer_name=$_POST['iname'];
$position=$_POST['pos'];
$date_of_interview=$_POST['dofin'];
$candidates_name=$_POST['cdname'];
$communicationab=$_POST['cabilities'];
$professionalap=$_POST['papp'];
$compskills=$_POST['compskill'];
$businessknd=$_POST['bkno'];
$inter_comment=$_POST['icomm'];
$dbc=mysql_connect("localhost","root","AidanCT11") or die("mysql_error()");
mysql_select_db("regisdb")or die("mysql_error()");
$query=mysql_query("select * from candidate");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while ($line = mysql_fetch_array($numrows, MYSQL_ASSOC)) {
echo $line['iname'];
echo $line['pos'];
echo $line['dofin'];
echo $line['cdname'];
echo $line['cabilities'];
echo $line['papp'];
echo $line['compskill'];
echo $line['bkno'];
echo $line['icomm'];
echo "<br> ";
;
}
</body></html>
The main page comes up fine, but after the main page it comes up: arse error: syntax error, unexpected 'interview' (T_STRING), expecting ',' or ';' in C:Course Technology87-5Chapter.09Projectcandidate.php on line 23.
If there is anyone that can assist it would be greatly appreciated.
Explanation / Answer
Solution:
One strange thing is the code on line no 23 in your candidate.php is :
echo "<a href="interview.html">Go Back</a>";
The issue is you are using double quotes inside double quotes. Hence the solution will be
echo '<a href="interview.html">Go Back</a>';
Hope this helps.