Could really use some help. Here is what I must do: Create a Web site for tracki
ID: 3912843 • Letter: C
Question
Could really use some help.
Here is what I must do: 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 have so far:
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 interview.php comes up fine, but I receive the following error once I try to place in the information and hit submit:
Notice: Undefined index: compskill in C:Course Technology87-5Chapter.09Projectcandidate.php on line 8
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:Course Technology87-5Chapter.09Projectcandidate.php on line 12
Error: Call to undefined function mysql_connect() in C:Course Technology87-5Chapter.09Projectcandidate.php on line 12
...candidate.php:0
If I could get anybody's help on this it would be greatly appreciated and greatly needed.
Call Stack # Time Memory Function Location 1 0.0443 409120 {main}( ) ...candidate.php:0Explanation / Answer
Notice: Undefined index: compskill in C:Course Technology87-5Chapter.09Projectcandidate.php on line 8
$compskills=$_POST['Compskill'];
<?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=mysqli_connect("localhost","root","AidanCT11", "regisdb") or die("mysql_error()");
$que = 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_comment."')");
if(mysqli_affected_rows($que) > 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);
}
?>
If you still getting undefined function mysqli_connect() fatal error, that means mysql socket not connected to php server...