📁 File Manager
Editing:
/home/wvl7mof7402e/public_html/chemtechieg.com/registration.php
<?php include "dbconnect.php"; // Database Connection if(isset($_POST['submit'])) { // **Form Data Secure करना** $username = mysqli_real_escape_string($con, $_POST['username']); $email = mysqli_real_escape_string($con, $_POST['useremail']); $password = mysqli_real_escape_string($con, $_POST['password']); $cpassword = mysqli_real_escape_string($con, $_POST['cpassword']); $location = mysqli_real_escape_string($con, $_POST['location']); $country = mysqli_real_escape_string($con, $_POST['country']); $student = mysqli_real_escape_string($con, $_POST['student']); $collage = mysqli_real_escape_string($con, $_POST['collage']); $organisation = mysqli_real_escape_string($con, $_POST['organisation']); $years = mysqli_real_escape_string($con, $_POST['years']); $purpose = mysqli_real_escape_string($con, $_POST['purpose']); $mobile = mysqli_real_escape_string($con, $_POST['mobile']); $agree = isset($_POST['agree']) ? 'yes' : 'no'; if ($password !== $cpassword) { echo "<script>alert('❌ Passwords do not match!'); window.location.href='register.php';</script>"; exit(); } // ✅ Password को Secure Hash करें (bcrypt) $hashed_password = password_hash($password, PASSWORD_BCRYPT); // **Step 1: Check if email or mobile already exists** $checkUser = "SELECT * FROM user_register WHERE email = '$email' OR mobile = '$mobile' LIMIT 1"; $result = mysqli_query($con, $checkUser); if(mysqli_num_rows($result) > 0) { echo "<script>alert('You are already registered! Please login instead.'); window.location.href='login.php';</script>"; exit(); } // **File Upload Directory** $uploadDir = "uploads/"; if (!file_exists($uploadDir)) { mkdir($uploadDir, 0777, true); // Create folder if not exists } // **File Upload Function** function uploadFile($file, $uploadDir) { if (isset($file) && $file['error'] == 0) { $fileName = rand(111111111,999999999) . "_" . basename($file["name"]); $targetPath = $uploadDir . $fileName; if (move_uploaded_file($file["tmp_name"], $targetPath)) { return $fileName; } } return null; } // **Files Upload** $doc1 = isset($_FILES["doc1"]) && $_FILES["doc1"]["name"] ? uploadFile($_FILES["doc1"], $uploadDir) : null; $doc2 = isset($_FILES["doc2"]) && $_FILES["doc2"]["name"] ? uploadFile($_FILES["doc2"], $uploadDir) : null; $doc3 = isset($_FILES["doc3"]) && $_FILES["doc3"]["name"] ? uploadFile($_FILES["doc3"], $uploadDir) : null; // Insert data into database $sql = "INSERT INTO user_register (username, email, password, location, country, student, collage, organisation, years, purpose, mobile, doc1, doc2, doc3, agree, status) VALUES ('$username', '$email', '$hashed_password', '$location','$country', '$student', '$collage', '$organisation', '$years', '$purpose', '$mobile', " . ($doc1 ? "'$doc1'" : "NULL") . ", " . ($doc2 ? "'$doc2'" : "NULL") . ", " . ($doc3 ? "'$doc3'" : "NULL") . ", '$agree', 1)"; if (mysqli_query($con, $sql)) { // Redirect to the Razorpay payment page with user details echo "<script>window.location.href='payment.php?username=$username&email=$email&mobile=$mobile';</script>"; } else { echo "<script>alert('Error: " . mysqli_error($con) . "');</script>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Registration Form</title> <!-- Bootstrap CSS --> <script src="code.jquery.com/jquery-3.3.1.js"></script> <link rel="stylesheet" type="text/css" href="css/bootstrap.min-2.css"> <style> body { background-color: #f4f4f4; /* Background Color */ background-image: url('img/reback.jpg'); /* Background Image */ background-size: cover; background-position: center; height: 100vh; } .container { background-color: rgba(0, 0, 0, 0.8); padding: 25px; width: 800px; border-radius: 30px; text-align: center; box-shadow: 0px 0px 15px rgba(255, 255, 255, 0.2); color: white; } .form-control, .form-check-input { border-radius: 10px; margin-bottom: 15px; } .btn { border-radius: 25px; padding: 10px 20px; } .form-group label { font-weight: bold; } </style> </head> <body> <!-- Instruction Modal --> <div class="modal fade" id="instructionModal" tabindex="-1" aria-labelledby="instructionModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="instructionModalLabel">Instructions for Filling the Form</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body" style="color: black;"> <!-- Text color set to black --> <ul> <li>Please provide login credentials, Student Name.</li> <li>Please provide login credentials, E-Mail ID, Password, City, and Country.</li> <li>Please mention whether the Candidate is a Student or a Professional.</li> <li>College of pass-out (if Student).</li> <li>If Professional, please mention the company name.</li> <li>Year of Experience for Professionals, for Students it is Zero.</li> <li>Reason for Certification Course, Contact Number.</li> <li>Upload documents like Pan Card, Aadhar Card.</li> <li>Upload mark-sheet for Students and Experience Certificate for Professionals.</li> <li>Read the Terms & Conditions and then submit the form.</li> </ul> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> </div> </div> </div> </div> <!-- Form Container --> <div class="container"> <div class="row"> <div class="col m-5"> <h4 class="text-center text-uppercase font-weight-bold my-4" style="position: relative; top: -60px;">Student/Professional Form</h4> <form method="POST" enctype="multipart/form-data" id="frmadmission" style="margin-top: -63px;"> <div class="row"> <div class="form-group col-md-6"> <input type="text" class="form-control" name="username" placeholder="Name" required autocomplete="off"> </div> <div class="form-group col-md-6"> <input type="email" class="form-control" name="useremail" placeholder="Email " required autocomplete="off"> </div> </div> <div class="row"> <div class="form-group col-md-6"> <input type="password" class="form-control" name="password" placeholder="Password" required autocomplete="off"> </div> <div class="form-group col-md-6"> <input type="password" class="form-control" name="cpassword" placeholder="Confirm Password" autocomplete="off"> </div> </div> <div class="row"> <div class="form-group col-md-6"> <input type="location" name="location" class="form-control" id="location" placeholder="City" required> </div> <div class="form-group col-md-6"> <input type="country" name="country" class="form-control" id="country" placeholder="Country" required> </div> </div> <div class="row"> <div class="form-group col-md-6"> <input type="student" class="form-control" name="student" placeholder="Student or Professional" autocomplete="off"> </div> <div class="form-group col-md-6"> <input type="collage" name="collage" class="form-control" id="collage" placeholder="Collage Name" required> </div> </div> <div class="row"> <div class="form-group col-md-6"> <input type="organisation" class="form-control" name="organisation" placeholder="Organisation Name (For Professional)" autocomplete="off"> </div> <div class="form-group col-md-6"> <select id="years" class="form-control" name="years" required> <option value="">Select Experience</option> </select> <script> let expSelect = document.getElementById("years"); for (let i = 0; i <= 50; i++) { let option = document.createElement("option"); option.value = i; option.textContent = i + (i === 1 ? " Year" : " Years"); expSelect.appendChild(option); } </script> </div> </div> <div class="row"> <div class="form-group col-md-6"> <input type="purpose" name="purpose" class="form-control" placeholder="Purpose Of Certification" required> </div> <div class="form-group col-md-6"> <input type="mobile" id="mobile" class="form-control" name="mobile" pattern="[0-9]{10}" maxlength="10" placeholder="mobile No" required> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label for="doc1">Upload Pan Card and Photo:</label> <input type="file" name="doc1" class="form-control-file border p-1"> </div> <div class="form-group col-md-6"> <label for="doc1">Upload Adharcard:</label> <input type="file" name="doc2" class="form-control-file border p-1"> </div> </div> <div class="form-group col-md-13"> <label for="doc1">Upload Documents:</label> <input type="file" name="doc3" class="form-control-file border p-1"> </div> <div class="row"> <div class="col-md-6"> <input class="form-check-input" type="checkbox" name="agree" id="agree" required> <span> I have read and agree to the terms & conditions*</span> </div> </div> <div id="msg" class="text-success"></div> <button name="submit" class="btn bg-info w-auto">submit</button> </form> <!-- Modal for Terms and Conditions --> <div class="modal fade" id="termsModal" tabindex="-1" aria-labelledby="termsModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="termsModalLabel">Terms and Conditions</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body" style="color: black;"> <!-- Text color set to black --> Welcome to the CHEMTECHIE ENGINEERING AND CONSULTING SERVICES PVT.LTD., web site. We request you to go through the Terms and Conditions (referred as T&C here on) carefully before you proceed to use this site. By using this site, you agree to comply with our given T&C and are bound to it. If you do not agree with T&C, we request you to refrain from using this Site</p> <h4> Acceptance of Agreement</h4> <p>You hereby agree to the T&C given in this Terms and Conditions Agreement with respect to our site. This agreement incorporates the entirety of the agreement and will be the only such said agreement between us and you. Also, encompasses and supersedes all the prior or ongoing agreements, representations, warranties, and any understandings, we state w.r.t the site. Moreover, the content, products, or any other services that are the sole property of CHEMTECHIE ENGINEERING AND CONSULTING SERVICES PVT.LTD., presented on the site or found elsewhere is our copyright. </p> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <p> <a href="terms_and_conditions.html">Read More*</a> </p> </div> </div> </div> </div> <!-- Bootstrap JS & Popper.js --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script> </body> </html> <!-- Registration Form (hidden initially) --> <!-- Bootstrap JS & Popper.js --> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script> <script> // Show the instruction modal when the page loads window.onload = function() { var instructionModal = new bootstrap.Modal(document.getElementById("instructionModal")); instructionModal.show(); }; // If the user clicks "I Agree", hide the modal and show the registration form document.getElementById("agreeBtn").onclick = function() { var instructionModal = new bootstrap.Modal(document.getElementById("instructionModal")); instructionModal.hide(); // Close the modal document.getElementById("registrationForm").style.display = "block"; // Show the registration form }; </script> </body> </html>
Save
Cancel