This is index.php
<?php
session_start();
include_once('process.php');
if(isset($_POST['submit']))
{
$fullname = isset($_POST['fullname']);
$email = isset($_POST['email']);
$mobile = isset($_POST['mobile']);
$location = isset($_POST['location']);
$program = isset($_POST['program']);
$dateoofbirth = $_POST['day']."-".$_POST['month']."-".$_POST['year'];
}
?>
<?php
$fullname = isset($_POST['fullname']);
$email = isset($_POST['email']);
$mobile = isset($_POST['mobile']);
$location = isset($_POST['location']);
$program = isset($_POST['program']);
$dateofbirth = isset($_POST['day'])."-". isset($_POST['month'])."-".isset($_POST['year']);
?>
<div class="container-fluid">
<div class="row" id="banner">
<div class="col-md-8">
<img src="images/images.png" style="height:500px; width:671px;">
</div>
<div class="col-md-4">
<div class="container">
<form>
<div class="form-row">
<div class="form-group">
<label for="name"></label>
<input type="text" class="form-control" id="fullname" name="fullname" value="<?php echo
isset($_POST['fullname']); ?>" placeholder="ENTER NAME">
</div>
<div class="form-group">
<label for="email"></label>
<input type="email" class="form-control" id="email" name="email" value="<?php echo
isset($_POST['email']); ?>" placeholder="ENTER EMAIL">
</div>
</div>
<div class="form-group">
<label for="mobile"></label>
<input type="text" class="form-control" id="mobile" name="mobile" value="<?php echo
isset($_POST['mobile']); ?>" placeholder="ENTER MOBILE NUMBER">
</div>
<div class="form-group">
<label for="location"></label>
<input type="text" class="form-control" id="location" name="location"
value="<?php echo isset($_POST['location']); ?>" placeholder="ENTER LOCATION">
</div>
<div class="form-group">
<select class="form-control" id="program" name="program" required>
<option value="program"><?php echo isset($_POST['program']); ?></option>
<option value="PG Diploma Programs">PG Diploma Programs</option>
<option value="Diploma Programs">Diploma Programs</option>
<option value="Certificate Programs">Certificate Programs</option>
</select>
</div>
<div class="wrapper">
<!---<input type="submit" id= "submit" name="submit" value="Submit"/>-->
<input type="submit" id="submit" name="submit" class="btn btn-primary" value="SEND ENQUIRY">
</div>
This is process.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "myDB";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
<?php
if(isset($_POST['submit']))
{
$fullname = addslashes($_POST['fullname']);
$email = addslashes($_POST['email']);
$mobile = addslashes($_POST['mobile']);
$location = addslashes($_POST['location']);
$program = addslashes($_POST['program']);
$dobArr = array($_POST['day']."-". $_POST['month']."-".$_POST['year']);
$dateofbirth = implode('-',$doArr);
date_default_timezone_set('Asia/Calcutta');
$today = date('d-m-Y H:i:s');
}
$sql = "INSERT INTO enquiry(id,fullname,email,mobile,location,program,dateofbirth)
VALUES ('', '".isset($_POST["fullname"])."', '".isset($_POST["email"])."','".isset($_POST["mobile"])."','".isset($_POST["location"])."','".isset($_POST["program"])."','".isset($_POST["dateofbirth"])."')";
?>
<?php
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
}
else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
inserting table data name,email,mobile ,location as value 1 .
it should be some name as richard ,richard@gmail.com,54234523452,and new york as location.
[here is my table ][1]
what is the issue in the code
i have try everyything from m side
if required more file will help
how is the data is shown as 1 instead it show name and email ,location
i have try everyything from m side
if required more file will help
how is the data is shown as 1 instead it show name and email ,location
i have try everyything from m side if required more file will help how is the data is shown as 1 instead it show name and email ,location i have try everyything from m side if required more file will help how is the data is shown as 1 instead it show name and email ,location if required more file will help how is the data is shown as 1 instead it show name and email ,location