Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I desperately need assistance in getting this right before Monday and could use

ID: 3913406 • Letter: I

Question

I desperately need assistance in getting this right before Monday and could use anybody's assistance to get this to work. Here is the question I need to answer:

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 ?elds for the interviewer’s name, position, and date of interview. Also include ?elds for entering the candidate’s name, communication abilities, professional appearance, 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?i?In php with html document.

Here is what I currently 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

$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", "interview") 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);
}
?><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 webpage comes up perfectly fine and I am able to place in all the information into the text boxes. Below is an image of the main page for the site:

Once I hit the submit button with all the information filled out, I receive the following:

This is also supposed to have a link to open a document with each candidate that has been interviewed. My head is spinning right now and I could really use some help. I am using Wampserver64 to run MySQL and there hasn't been a database created to store the information, other than the one annotated in the code. I could really use some help if someone could please assist me.

Explanation / Answer

hello keep your HTML file seperately I assume it as index.php which i have not attached here as you can use your same code. below are codes for connecting with database insertion and retirval followed by pdf file of the information. The mistake in your above code is in nthe mysql query where you have to give name of the table column name instead of the text box names in the insert into candiate(table column names).........

Databse.php : connecting to mysql database

Add.php : inserting to the database

Display.php: Display as table in HTML file

pdf.php : Display contents in pdf file

DATABASE.PHP :

Code to connect the form to mysql database

<?php

$connect=mysqli_connect('localhost','root','123','mydatabase');

if(mysqli_connect_errno($connect))

{

                                echo 'Failed to connect';

}

?>

Add.php

<?php include 'database.php'; ?>

<?php

// create a variable

$iname=$_POST['iname'];

$pos=$_POST['pos'];

$dofin=$_POST['dofin'];

$cdname=$_POST['cdname'];

$cabilities=$_POST['cabilities'];

$paapp=$_POST['papp'];

$compskill=$_POST['compskill'];

$bkno=$_POST['bkno'];

$icomm=$_POST['icomm'];

//Execute the query

mysqli_query($connect,"INSERT INTO candidate (Interviewer’s name, Position, Date of interview, Candidate's Name, Communication Abilities, Professionlal Apperance, Computer Skills, Business Knowldge, Interviewer’s Comment)

VALUES (‘$iname’,’$pos’,’$dofin’,’$cdname’,’$cabilities’,’$papp’,’$compskill’,’$bkno’,’$icomm’)");

                if(mysqli_affected_rows($connect) > 0){

                echo "<p>information Added</p>";

                echo "<a href="index.html">Go Back</a>";

} else {

                echo "information NOT Added<br />";

                echo mysqli_error ($connect);

}

Display.php

<?php include 'database.php'; ?>

<h1>Information</h1>

                <?php

$result=mysqli_query(select * from candidate");?>

                <table width="500" cellpadding=5celspacing=5 border=1>

                <tr>

                <tr><td><label>Interviewer’s name:</label></td>

                </tr>
<tr><td><label>Position:</label></td>

</tr>
<tr><td><label>Candidate's Name:</label></td>

</tr>
<tr><td><label>Date of interview:</label></td>

</tr>
<tr><td><label>Communication Abilities:</label></td>

</tr>
<tr><td><label>Professionlal Apperance:</label></td>

</tr>
<tr><td><label>Computer Skills:</label></td>

</tr>
<tr><td><label>Business Knowldge:</label></td>

</tr>
<tr><td><label>Interviewer’s Comment:</label></td>

</tr>

</tr>

<?php while($row=mysqli_fetch_array($result)):?>

                <tr>

                <td><?php echo $row[‘iname’];?></td>

                <td><?php echo $row[’pos’];?></td>

                <td><?php echo $row['dofin'];?></td>

<td><?php echo $row['cdname'];?></td>

<td><?php echo $row['capabilities'];?></td>

<td><?php echo $row['papp'];?></td>

<td><?php echo $row['compskill'];?></td>

<td><?php echo $row['bkno'];?></td>

<td><?php echo $row['icomm'];?></td>

                </tr>

                <?php endwhile;?>

                </table>

<a href=”pdf.php”>Click to download the PDF</a>

<? php } ?>  

Pdf.php

Download and Install fpdf class from http://www.fpdf.org/
Keep a copy of fpdf.php file in the same directory
Keep the font directory inside in the same directory.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote