syazwinashahrani / KTMonline.com

KTM system is a website that provide a user to purchase train ticket online
0 stars 0 forks source link

KTMonline.com

KTM system is a website that provide a user to purchase train ticket online

<?php session_start(); if(isset($_SESSION['name'])){} else{ header("location:login1.php");

}

$tbl_name="users"; // Table name $name=$_SESSION['name'];

require('firstimport.php');

mysqli_select_db($conn,"$db_name") or die("cannot select db");

$result=mysqli_query($conn,"SELECT * FROM $tbl_name WHERE f_name='$name'"); $row=mysqli_fetch_array($result);

?>

First Name :
Last Name :
E-Mail :
Dob :
Gender :
Marital Status :
Mobile No :
Security Question :
Answer :
First Name
Last name
E-Mail
Dob
Gender
Marital Status
Mobile No.
Security Question
Answer

use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception;

include 'PHPMailer/src/Exception.php'; include 'PHPMailer/src/PHPMailer.php'; include 'PHPMailer/src/SMTP.php';

$mail = new PHPMailer(true);try {//Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'syztripinmy@gmail.com' ; $mail->Password = 'tripinmy2021' ; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587;

$mail->setFrom('syazwinashahrani@gmail.com');// send to one recepient only, name is optional 2nd argument $mail->addAddress($email); $mail->isHTML(true); $mail->Subject = 'KTM SDN BHD' ; $mail->Body = "

Hi Mr/Mrs $f_name $l_name,

You have successfully purchase KTM ticket from $routes[$origin] to $routes[$destination]

For more information, please contact management directly.


TICKET - ITINERY

From To Category
$routes[$origin] $routes[$destination] $category


Passenger details

Name : $f_name $l_name
IC Number : $icnum
Email : $email

Thank You for using KTM.com!

" ; $mail->send(); echo "

Message has been sent to $email.

"; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } ?>