1
1
php
session_start();
// Check if user is logged in
if (!isset($_SESSION['conuserid'])) {
header("Location: user_register.php");
exit();
}
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$result = $conn->query($sql);
// var_dump($result);
if ($result->num_rows > 0) {
// Fetch user details
$user = $result->fetch_assoc();
$first_name = $user['cfname'];
$last_name = $user['clastname'];
$email = $user['cemail'];
$mobile = $user['cmobile'];
$name = $first_name . ' ' . $last_name;
$email = $email;
$mobile = $mobile;
} else {
// Handle the case where user data is not found
echo "User not found.";
exit();
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>World Water Day</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="The conference will be held for three days.
14th December 2022 to 16th December 2022">
<style>
.containerbox {
display: flex;
justify-content: center;
align-items: flex-start; /* Align items to the top */
flex-wrap: wrap;
gap: 20px;
padding: 50px 20px;
}
.card {
background: white;
padding: 25px;
border-radius: 12px;
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
text-align: center;
}
.guidelines {
width: 80%;
/* max-width: 400px; */
text-align: left;
}
.guidelines1 {
width: 100%;
/* max-width: 500px; */
text-align: left;
margin-left:0px
}
.guidelines h2 {
text-align: center;
color: #007BFF;
font-size: 22px;
}
.guidelines ul {
list-style: none;
padding: 0;
}
.guidelines ul li {
padding: 3px;
border-bottom: 1px solid #eee;
font-size:14px
}
.submission-form {
/* width: 55%; */
/* max-width: 500px; */
}
.submission-form h2 {
color: #007BFF;
font-size: 22px;
}
input, textarea {
width: 100%;
padding: 12px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
button {
background-color: #007BFF;
color: white;
padding: 12px 16px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
width: 100%;
transition: 0.3s;
}
button:hover {
background-color: #0056b3;
}
form label {
display: block;
text-align: left;
font-weight: bold;
margin-top: 10px;
}
<div class="containerbox">
<div class="card guidelines">
<h2><strong>Guidelines</strong></h2>
<ul>
<li>1. Only individual papers will be accepted.</li>
<li>2. Group submissions are not permitted.</li>
<li>3. One person may only submit one paper. .</li>
<li>4. Mode of submission: Online</li>
<li>5. Payment: Online Joining Fee: Rs. 500/-. </li>
<li>6. Age limit: 18–35 years (Aadhar is for verification).
</li>
<li>7. Please upload a screenshot of the payment slip once the amount
has been submitted.</li>
</ul>
</div>
<label for="email">Email</label>
<input type="email" name="email" placeholder="Your Email" value="<?php
echo isset($email) ? $email : ''; ?>" >
</div><br>
<label for="attachment"> Please upload max 2 Supporting figures (if any), maximum
image size:5MB:</label>
<input type="file" name="figure2" id="figure2" accept="image/*" >
<input type="file" name="figure3" id="figure3" accept="image/*">
</div><br>
<label>Branch Address:</label>
<input type="text" value="Maidamgaon, Basistha, Kamrup(M) Assam-781029"
readonly class="form-control">
<label>Bank Name:</label>
<input type="text" value="UNION BANK OF INDIA" readonly class="form-
control">
<label>IFSC Code:</label>
<input type="text" value="UBIN0539465" readonly class="form-control">
<label for="payment_slip">Upload Payment Slip / Screenshot (Image/PDF),
maximum image size:5MB:</label>
<input type="file" name="payment_slip" id="payment_slip"
accept="image/*,.pdf" >
</form>
</div>
</div>
<?php
if (isset($_POST['submit'])) {
// Database connection details
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "stream22";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$allowedMimeTypes = [
'application/pdf',
'application/msword',
'application/vnd.openxmlformats-
officedocument.wordprocessingml.document',
'image/jpeg',
'image/png',
'image/gif'
];
if (!in_array($mime, $allowedMimeTypes)) {
die("Invalid file type: " . htmlspecialchars($file['name']));
}
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
// Close connection
$conn->close();
}
?>
<script>
document.addEventListener("DOMContentLoaded", function () {
const form = document.querySelector("form");
const emailField = document.querySelector('input[name="email"]');
const mobileField = document.querySelector('input[name="mobile"]');
const messageField = document.getElementById("message");
const wordCountDisplay = document.getElementById("wordCount");
function validateForm() {
let isValid = true;
let errorMessage = "";
// Name validation
const name = document.querySelector('input[name="name"]').value.trim();
if (name === "") {
errorMessage += "Name is .\n";
isValid = false;
}
// Email validation
const email = emailField.value.trim();
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]
{2,}$/;
if (!emailPattern.test(email)) {
errorMessage += "Invalid email format.\n";
isValid = false;
}
// Mobile validation
const mobile = mobileField.value.trim();
const mobilePattern = /^[6-9]\d{9}$/;
if (!mobilePattern.test(mobile)) {
errorMessage += "Invalid mobile number. It must be a 10-digit
number starting with 6-9.\n";
isValid = false;
}
// File validation
const validFileExtensions = [".pdf", ".doc", ".ppt", ".pptx"];
validateFile(document.getElementById("attachment"),
validFileExtensions, "Document");
validateFile(document.getElementById("figure1"), validImageExtensions,
"Aadhar/PAN card image");
validateFile(document.getElementById("payment_slip"),
validImageExtensions.concat(".pdf"), "Payment Slip");
if (!isValid) {
alert(errorMessage);
}
return isValid;
}
<script src="js/slider.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.bxslider.min.js"></script>
<script src="js/jquery.appear.js"></script>
<script src="js/circle-progress.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery-parallax.js"></script>
<script src="js/validate.js"></script>
<script src="js/jquery.mixitup.min.js"></script>
<script src="js/jquery.fancybox.pack.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/jquery.countTo.js"></script>
<script src="js/isotope.pkgd.min.js"></script>
<script src="js/jquery-ui-1.11.4/jquery-ui.js"></script>
<script src="js/custom.js"></script>
</body>
</html>