AppsTy






Secure Chatbot in PHP | AppsTy


Chatbot Icon



@import url(‘https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap’);

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: ‘Poppins’, sans-serif;
}

html, body {
display: grid;
height: 100%;
place-items: center;
}

::selection {
color: #fff;
background: #4CAF50;
}

::-webkit-scrollbar {
width: 8px;
border-radius: 25px;
}

::-webkit-scrollbar-track {
background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
background: #3498db;
border-radius: 25px;
transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
background: #2980b9;
}

.wrapper {
width: 370px;
background: linear-gradient(135deg, #3498db, #9b59b6);
border-radius: 15px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border: 2px solid #2980b9;
border-top: 0px;
overflow: hidden;
animation: fadeInUp 0.8s ease-in-out;
transform-origin: bottom;
}

.wrapper .title {
background: #3498db;
color: #fff;
font-size: 20px;
font-weight: 500;
line-height: 60px;
text-align: center;
border-bottom: 1px solid #2980b9;
border-radius: 15px 15px 0 0;
}

.wrapper .form {
padding: 20px 15px;
min-height: 400px;
max-height: 400px;
overflow-y: auto;
transition: background 0.3s ease;
}

.wrapper .form .inbox {
width: 100%;
display: flex;
align-items: baseline;
animation: fadeInUp 0.8s ease-in-out;
}

.wrapper .form .user-inbox {
justify-content: flex-end;
margin: 13px 0;
}

.wrapper .form .inbox .icon {
height: 40px;
width: 40px;
color: #fff;
text-align: center;
line-height: 40px;
border-radius: 50%;
font-size: 18px;
background: #3498db;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.wrapper .form .inbox .msg-header {
max-width: 53%;
margin-left: 10px;
}

.form .inbox .msg-header p {
color: #fff;
background: #3498db;
border-radius: 10px;
padding: 8px 10px;
font-size: 14px;
word-break: break-word;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
transition: background 0.3s ease;
animation: slideInLeft 0.5s ease;
}

.form .user-inbox .msg-header p {
color: #333;
background: #ecf0f1;
animation: slideInRight 0.5s ease;
}

.wrapper .typing-field {
display: flex;
height: 60px;
width: 100%;
align-items: center;
justify-content: space-evenly;
background: #ecf0f1;
border-top: 1px solid #bdc3c7;
border-radius: 0 0 15px 15px;
animation: fadeInUp 0.8s ease-in-out;
}

.wrapper .typing-field .input-data {
height: 40px;
width: 335px;
position: relative;
}

.wrapper .typing-field .input-data input {
height: 100%;
width: 100%;
outline: none;
border: 1px solid transparent;
padding: 0 80px 0 15px;
border-radius: 3px;
font-size: 15px;
background: #fff;
transition: all 0.3s ease;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.typing-field .input-data input:focus {
border-color: #3498db;
}

.input-data input::placeholder {
color: #999999;
transition: all 0.3s ease;
}

.input-data input:focus::placeholder {
color: #bfbfbf;
}

.wrapper .typing-field .input-data button {
position: absolute;
right: 5px;
top: 50%;
height: 30px;
width: 65px;
color: #fff;
font-size: 16px;
cursor: pointer;
outline: none;
opacity: 0;
pointer-events: none;
border-radius: 3px;
background: #3498db;
border: 1px solid #3498db;
transform: translateY(-50%);
transition: all 0.3s ease;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
animation: fadeIn 0.5s ease-in-out;
}

.wrapper .typing-field .input-data input:valid ~ button {
opacity: 1;
pointer-events: auto;
}

.typing-field .input-data button:hover {
background: #2980b9;
transform: scale(1.05);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
} prepare(“INSERT INTO query (query, emailid) VALUES (?, ?)”);
$stmt->bind_param(“ss”, $query, $emailid);

// Execute the statement
if ($stmt->execute()) {
echo “Thank you for providing your email!”; // Message to the user
} else {
echo “Error: Unable to insert data into database.”;
}

// Close the statement
$stmt->close();
} else {
echo “No data received.”;
}

mysqli_close($conn);

— phpMyAdmin SQL Dump
— version 3.5.2
— http://www.phpmyadmin.net

— Host: localhost
— Generation Time: Apr 28, 2021 at 08:45 PM
— Server version: 5.5.25a
— PHP Version: 5.4.4

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;
SET time_zone = “+00:00”;

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


— Database: `bott`

— ——————————————————–


— Table structure for table `query`

CREATE TABLE `query` (
`query` varchar(100) NOT NULL,
`emailid` varchar(120) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


— Dumping data for table `query`

INSERT INTO `query` (`query`, `emailid`) VALUES (‘$query’, ‘$emailid’);

— ——————————————————–


/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Scroll to Top