Application utilizing MySQL, PHP, Javascript With the following information, dev
ID: 3817709 • Letter: A
Question
Application utilizing MySQL, PHP, Javascript
With the following information, develop a backend database, create the PHP to communicate with the database and enter & retrieve information, and implement JavaScript front end capabilities such as captcha verification. App can be made using bootstrap or CSS code. Authentication will performed, but the username and password may be hardcoded. That is, the employee will call you to register, and you will email them a username and password.
Information to be utilized (employer):
Employer:
• Text Box: Name of the Company, Name of the Manager, Address, Phone, Email
• A company may post many positions. For each position, provide:
• Text: Position Title
• Text: Description
• Drop Down: Location of the position (state)
• Top 3 Skills: Skill (Pull Down), Experience: Pull Down - 0, 1-3, 3-5, 5-10, 10+
• Need: Radio: Urgent (<1 month), Soon (1-3 months), Upcoming (3+ months)
Code so far:
$servername = "localhost";
$username = "root";
$password = "1234";
$dbname = "company";
$connection = mysqli_connect("localhost" , "root" , "1234" , "company"); //It will connect you to database
if($connection == false)
{
die("connection failed");
}
$insert = INSERT INTO company (company , managername , address , phone , email) VALUES ('ABC' , 'swati' , 'rubyt park pune' , 8877665544' , 'swati@abc.com')
if($connection -> query($insert) == true)
{
dei("record entered successfully");
}
$retrieve = SELECT * from company
if($connection -> query($retrieve) == true)
{
dei("record found successfully");
}
$conn->close();
Explanation / Answer
<?
$con = mysql_connect("localhost","inmoti6_myuser","mypassword");
in the event that (!$con)
{
die('Could not interface: " . mysql_error());
}
mysql_select_db("inmoti6_mysite", $con);
$article_id = $_GET['id'];
in the event that( ! is_numeric($article_id) )
die('invalid article id');
$query = "SELECT * FROM `comments` WHERE `articleid` =$article_id LIMIT 0 , 30";
$comments = mysql_query($query);
resound "<h1>User Comments</h1>";
/Please recall that mysql_fetch_array has been expostulated in before
/adaptations of PHP. As of PHP 7.0, it has been supplanted with mysqli_fetch_array.
while($row = mysql_fetch_array($comments, MYSQL_ASSOC))
{
$name = $row['name'];
$email = $row['email'];
$website = $row['website'];
$comment = $row['comment'];
$timestamp = $row['timestamp'];
$name = htmlspecialchars($row['name'],ENT_QUOTES);
$email = htmlspecialchars($row['email'],ENT_QUOTES);
$website = htmlspecialchars($row['website'],ENT_QUOTES);
$comment = htmlspecialchars($row['comment'],ENT_QUOTES);
resound " <div>
Name: $name<br/>
Email: $email<br/>
Site: $website<br/>
Remark: $comment<br/>
Timestamp: $timestamp
</div>
";
}
mysql_close($con);
?>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.