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

Create a set of webpages that registers users for a professional conference. Use

ID: 3855075 • Letter: C

Question

Create a set of webpages that registers users for a professional conference. Use a session to track down users as they navigate through the web pages. Include three separate web pages that contain forms: the first form gathers the users name and contact information, the second form gathers the user’s company information, and the third form prompts users to select the seminars they want to attend at the conference. Include a fourth page that displays the submitted information. The fourth page should include links that allow users to edit the submitted data, along with a submit button that saves the information to a database. A fifth page should display a confirmation that the information was successfully saved. Include code based on reading e-mail addresses that prevent the same user to register twice. PHP

Explanation / Answer

phpinfo.html

<html>

<head>
<title>Sign-Up</title>
</head>
<body>
<div id="Sign-Up">
<fieldset>
<legend>Registration Form</legend>
<table border="0">
<tr>
<form method="POST" action="connectphpform.php">
<td>Email</td>
<td> <input type="text" name="email"></td>
</tr>
<tr>
<td>Password</td><td> <input type="password" name="pass"></td>
</tr>
<tr>
<td><input id="button" type="submit" name="submit" value="Sign-Up"></td>
</tr>
</form>
</table>
</fieldset>
</div>

</html>

connectphpform.php

CREATE TABLE conferencetbl
(
userID int(9) NOT NULL auto_increment, fullname VARCHAR(50) NOT NULL,
email VARCHAR(40) NOT NULL,
pass VARCHAR(40) NOT NULL, PRIMARY KEY(userID)
contactno int(9),
contact_name VARCHAR(40),
company_name VARCHAR(40),
seminar_name VARCHAR(40)
}
);


<?php
session_start();
$servername = "localhost";
$username = "username";
$password = "password";
$db="dbname"

// Create connection
$conn = new mysqli($servername, $username, $password,$db);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";

function NewUser()
{
$email = $_POST['email'];
$_SESSION['login_user']= $email;
$password = $_POST['pass'];
$query = "INSERT INTO conferencetbl (email,pass) VALUES ('$email','$password')";
$data = mysql_query ($query)or die(mysql_error()); if($data)
{
echo "YOUR REGISTRATION IS COMPLETED...";
header('contactinfo.php');
}
}
function SignUp()
{
if(!empty($_POST['email'])) //checking the 'email' which is from Sign-Up.html, is it empty or have some text
{
$query = mysql_query("SELECT * FROM conferencetbl WHERE email = '$_POST[email]' AND pass = '$_POST[pass]'") or die(mysql_error());
if(!$row = mysql_fetch_array($query) or die(mysql_error()))
{
newuser();
}
else
{
echo "SORRY...YOU'R EMAIL IS ALREADY REGISTERED ...";
}
}
}
if(isset($_POST['submit']))
{
SignUp();
}
?>

contactinfo.php

<html>

<head>
<title>Contact</title>
</head>
<body>
<div id="contact">
<fieldset>
<legend>Contact info</legend>
<table border="0">
<tr>
<form method="POST" action="companyinfo.php">
<td>User name</td>
<td> <input type="text" name="name"></td>
</tr>
<tr>
<td>contact no</td><td> <input type="number" name="number"></td>
</tr>
<tr>
<td><input id="button" type="submit" name="submit" value="contact"></td>
</tr>
</form>
</table>
</fieldset>
</div>
</body>

<?php

$servername = "localhost";
$username = "username";
$password = "password";
$db="dbname"

// Create connection
$conn = new mysqli($servername, $username, $password,$db);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";

if (isset($_POST['submit'])){
$name = $_POST['name'];
$no= $_POST['number'];
$_SESSION['contactname']= $name;
$_SESSION['contactno']= $no;
$query = "INSERT INTO conferencetbl (contact_name,contactno) VALUES ('$name',$no)";
$data = mysql_query ($query)or die(mysql_error()); if($data)
{
echo "contact info COMPLETED...";

}

}
?>
</html>

companyinfo.php

<head>

<title>Contact</title>

</head>

<body>

<div id="contact">

<fieldset>

<legend>Company info</legend>

<table border="0">

<tr>

<form method="POST" action="seminarinfo.php">

<td>Company name</td>

<td> <input type="text" name="cname"></td>

</tr>

<tr>

<td><input id="button" type="submit" name="submit" value="comapny"></td>

</tr>

</form>

</table>

</fieldset>

</div>

<body>

<?php

$servername = "localhost";

$username = "username";

$password = "password";

$db="dbname"

// Create connection

$conn = new mysqli($servername, $username, $password,$db);

// Check connection

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

}

echo "Connected successfully";

if (isset($_POST['submit'])){

$cname = $_POST['cname'];

$_SESSION['cname']= $cname;

  

$query ="INSERT INTO conferencetbl (company_name) VALUES ('$company_name')";

$data = mysql_query ($query)or die(mysql_error()); if($data)

{

echo "YOUR company details COMPLETED...";

}

}

?>

</html>

seminarinfo.php

<html>

<head>

<title>Contact</title>

</head>

<body>

<div id="contact">

<fieldset>

<legend>Contact info</legend>

<form method="POST" action="companyinfo.php">

<p> Which seminar</p>

<input type="radio" name="q1" value="1" />

seminar 1

<input type="radio" name="q1" value="2" />

seminar 2

<input type="radio" name="q1" value="3" />

seminar 3

<input id="button" type="submit" name="submit" value="seminar">

</form>

</table>

</fieldset>

</div>

<?php

$servername = "localhost";

$username = "username";

$password = "password";

$db="dbname"

// Create connection

$conn = new mysqli($servername, $username, $password,$db);

// Check connection

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

}

echo "Connected successfully";

if (isset($_POST['q1'])){

$q1 = $_POST['q1'];

$_SESSION['seminar']=$q1;

$query="INSERT INTO conferencetbl (seminar_name) VALUES ('$q1')";

$data = mysql_query ($query)or die(mysql_error()); if($data)

{

echo "YOUR seminar details COMPLETED...";

}

}

?>

</html>

display.php

<?php
echo "<h2>information is successfully saved</h2><br>";
echo 'Contact name '.$_SESSION['contactname'].'<br>';
echo 'Contact no '.$_SESSION['contactno'].'<br>';
echo 'Company name '.$_SESSION['cname'].'<br>';
echo 'seminar name '.$_SESSION['seminar'].'<br>';

?>

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