├── License.md ├── MYSQL FILES ├── furkan.sql ├── jack.sql ├── oliver.sql └── users_july.sql ├── README.md ├── add.php ├── connect.php ├── createTable.php ├── homepage └── homepage.php ├── index.php ├── loginPage └── login.php ├── navbar.php ├── pages ├── Inbox.php └── newMessage.php ├── register └── register.php └── styleFile ├── inbox.css ├── navbar.css ├── newMessage.css └── style.css /License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Codeblogger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /MYSQL FILES/furkan.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.8.5 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Anamakine: 127.0.0.1 6 | -- Üretim Zamanı: 17 Tem 2019, 20:59:27 7 | -- Sunucu sürümü: 10.1.39-MariaDB 8 | -- PHP Sürümü: 7.3.5 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET AUTOCOMMIT = 0; 12 | START TRANSACTION; 13 | SET time_zone = "+00:00"; 14 | 15 | 16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19 | /*!40101 SET NAMES utf8mb4 */; 20 | 21 | -- 22 | -- Veritabanı: `phptutorial` 23 | -- 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Tablo için tablo yapısı `furkan` 29 | -- 30 | 31 | CREATE TABLE `furkan` ( 32 | `messages_id` int(11) UNSIGNED NOT NULL, 33 | `header` varchar(100) NOT NULL, 34 | `messages_sender` varchar(100) NOT NULL, 35 | `messages_content` varchar(5000) NOT NULL, 36 | `messages_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 37 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 38 | 39 | -- 40 | -- Tablo döküm verisi `furkan` 41 | -- 42 | 43 | INSERT INTO `furkan` (`messages_id`, `header`, `messages_sender`, `messages_content`, `messages_date`) VALUES 44 | (1, 'First Email', 'oliver@gmail.com', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida arcu ac tortor dignissim convallis. Ut venenatis tellus in metus vulputate eu scelerisque. Scelerisque varius morbi enim nunc faucibus a pellentesque. Porta lorem mollis aliquam ut porttitor leo a diam. Nec feugiat nisl pretium fusce id velit ut. Enim eu turpis egestas pretium. Molestie at elementum eu facilisis. Orci dapibus ultrices in iaculis nunc sed augue lacus viverra. Cum sociis natoque penatibus et magnis dis parturient montes nascetur. Nisl rhoncus mattis rhoncus urna neque viverra justo nec. Morbi tristique senectus et netus et malesuada fames. Eget arcu dictum varius duis at consectetur lorem donec. Amet nulla facilisi morbi tempus iaculis urna id volutpat lacus.', '2019-07-17 18:07:40'), 45 | (2, 'How are you?', 'oliver@gmail.com', 'Quam vulputate dignissim suspendisse in est ante. Vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare. Orci ac auctor augue mauris. Et odio pellentesque diam volutpat commodo. Pulvinar pellentesque habitant morbi tristique. In est ante in nibh mauris cursus mattis. Egestas maecenas pharetra convallis posuere. Ultrices vitae auctor eu augue ut. Turpis egestas pretium aenean pharetra magna ac placerat. Lacus viverra vitae congue eu consequat ac felis.\r\n\r\nAt augue eget arcu dictum varius duis. Cursus euismod quis viverra nibh cras. Tellus rutrum tellus pellentesque eu. Vestibulum sed arcu non odio euismod. Sagittis purus sit amet volutpat. Pharetra magna ac placerat vestibulum lectus. At erat pellentesque adipiscing commodo elit at imperdiet. Nam aliquam sem et tortor consequat id porta nibh venenatis. Volutpat maecenas volutpat blandit aliquam etiam erat. Iaculis nunc sed augue lacus viverra vitae. In eu mi bibendum neque egestas congue. Id cursus metus aliquam eleifend mi in nulla.', '2019-07-17 18:08:13'), 46 | (3, 'I sent business documents', 'jack@gmail.com', 'Suspendisse faucibus interdum posuere lorem ipsum dolor sit. Lorem ipsum dolor sit amet consectetur adipiscing elit. Risus nec feugiat in fermentum posuere urna nec tincidunt. Lacus sed turpis tincidunt id. Lacus suspendisse faucibus interdum posuere lorem ipsum dolor sit. Rhoncus aenean vel elit scelerisque. Maecenas ultricies mi eget mauris pharetra et. Eget magna fermentum iaculis eu non. At urna condimentum mattis pellentesque. Turpis egestas integer eget aliquet nibh praesent. Congue nisi vitae suscipit tellus mauris a diam maecenas. Cras ornare arcu dui vivamus arcu felis bibendum ut tristique. Lacus viverra vitae congue eu consequat ac felis donec. Faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Tortor posuere ac ut consequat.\r\n\r\nTincidunt vitae semper quis lectus nulla at volutpat. Eget velit aliquet sagittis id consectetur purus ut faucibus. Donec enim diam vulputate ut pharetra sit amet aliquam. Vitae elementum curabitur vitae nunc sed velit dignissim sodales ut. Lacus vestibulum sed arcu non odio euismod lacinia at. Mauris a diam maecenas sed. Amet nisl purus in mollis nunc. Felis donec et odio pellentesque diam volutpat commodo sed. Non pulvinar neque laoreet suspendisse interdum consectetur libero id. Auctor eu augue ut lectus arcu bibendum. Egestas sed sed risus pretium quam vulputate.', '2019-07-17 18:14:06'); 47 | 48 | -- 49 | -- Dökümü yapılmış tablolar için indeksler 50 | -- 51 | 52 | -- 53 | -- Tablo için indeksler `furkan` 54 | -- 55 | ALTER TABLE `furkan` 56 | ADD PRIMARY KEY (`messages_id`); 57 | 58 | -- 59 | -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri 60 | -- 61 | 62 | -- 63 | -- Tablo için AUTO_INCREMENT değeri `furkan` 64 | -- 65 | ALTER TABLE `furkan` 66 | MODIFY `messages_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 67 | COMMIT; 68 | 69 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 70 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 71 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 72 | -------------------------------------------------------------------------------- /MYSQL FILES/jack.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.8.5 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Anamakine: 127.0.0.1 6 | -- Üretim Zamanı: 17 Tem 2019, 21:00:03 7 | -- Sunucu sürümü: 10.1.39-MariaDB 8 | -- PHP Sürümü: 7.3.5 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET AUTOCOMMIT = 0; 12 | START TRANSACTION; 13 | SET time_zone = "+00:00"; 14 | 15 | 16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19 | /*!40101 SET NAMES utf8mb4 */; 20 | 21 | -- 22 | -- Veritabanı: `phptutorial` 23 | -- 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Tablo için tablo yapısı `jack` 29 | -- 30 | 31 | CREATE TABLE `jack` ( 32 | `messages_id` int(11) UNSIGNED NOT NULL, 33 | `header` varchar(100) NOT NULL, 34 | `messages_sender` varchar(100) NOT NULL, 35 | `messages_content` varchar(5000) NOT NULL, 36 | `messages_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 37 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 38 | 39 | -- 40 | -- Dökümü yapılmış tablolar için indeksler 41 | -- 42 | 43 | -- 44 | -- Tablo için indeksler `jack` 45 | -- 46 | ALTER TABLE `jack` 47 | ADD PRIMARY KEY (`messages_id`); 48 | 49 | -- 50 | -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri 51 | -- 52 | 53 | -- 54 | -- Tablo için AUTO_INCREMENT değeri `jack` 55 | -- 56 | ALTER TABLE `jack` 57 | MODIFY `messages_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; 58 | COMMIT; 59 | 60 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 61 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 62 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 63 | -------------------------------------------------------------------------------- /MYSQL FILES/oliver.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.8.5 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Anamakine: 127.0.0.1 6 | -- Üretim Zamanı: 17 Tem 2019, 21:00:18 7 | -- Sunucu sürümü: 10.1.39-MariaDB 8 | -- PHP Sürümü: 7.3.5 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET AUTOCOMMIT = 0; 12 | START TRANSACTION; 13 | SET time_zone = "+00:00"; 14 | 15 | 16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19 | /*!40101 SET NAMES utf8mb4 */; 20 | 21 | -- 22 | -- Veritabanı: `phptutorial` 23 | -- 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Tablo için tablo yapısı `oliver` 29 | -- 30 | 31 | CREATE TABLE `oliver` ( 32 | `messages_id` int(11) UNSIGNED NOT NULL, 33 | `header` varchar(100) NOT NULL, 34 | `messages_sender` varchar(100) NOT NULL, 35 | `messages_content` varchar(5000) NOT NULL, 36 | `messages_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 37 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 38 | 39 | -- 40 | -- Tablo döküm verisi `oliver` 41 | -- 42 | 43 | INSERT INTO `oliver` (`messages_id`, `header`, `messages_sender`, `messages_content`, `messages_date`) VALUES 44 | (1, 'deneme', 'furkan@gmail.com', 'deneme 123', '2019-07-17 17:38:58'), 45 | (2, 'I sent business documents', 'jack@gmail.com', 'Suspendisse faucibus interdum posuere lorem ipsum dolor sit. Lorem ipsum dolor sit amet consectetur adipiscing elit. Risus nec feugiat in fermentum posuere urna nec tincidunt. Lacus sed turpis tincidunt id. Lacus suspendisse faucibus interdum posuere lorem ipsum dolor sit. Rhoncus aenean vel elit scelerisque. Maecenas ultricies mi eget mauris pharetra et. Eget magna fermentum iaculis eu non. At urna condimentum mattis pellentesque. Turpis egestas integer eget aliquet nibh praesent. Congue nisi vitae suscipit tellus mauris a diam maecenas. Cras ornare arcu dui vivamus arcu felis bibendum ut tristique. Lacus viverra vitae congue eu consequat ac felis donec. Faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Tortor posuere ac ut consequat.\r\n\r\nTincidunt vitae semper quis lectus nulla at volutpat. Eget velit aliquet sagittis id consectetur purus ut faucibus. Donec enim diam vulputate ut pharetra sit amet aliquam. Vitae elementum curabitur vitae nunc sed velit dignissim sodales ut. Lacus vestibulum sed arcu non odio euismod lacinia at. Mauris a diam maecenas sed. Amet nisl purus in mollis nunc. Felis donec et odio pellentesque diam volutpat commodo sed. Non pulvinar neque laoreet suspendisse interdum consectetur libero id. Auctor eu augue ut lectus arcu bibendum. Egestas sed sed risus pretium quam vulputate.', '2019-07-17 18:08:59'); 46 | 47 | -- 48 | -- Dökümü yapılmış tablolar için indeksler 49 | -- 50 | 51 | -- 52 | -- Tablo için indeksler `oliver` 53 | -- 54 | ALTER TABLE `oliver` 55 | ADD PRIMARY KEY (`messages_id`); 56 | 57 | -- 58 | -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri 59 | -- 60 | 61 | -- 62 | -- Tablo için AUTO_INCREMENT değeri `oliver` 63 | -- 64 | ALTER TABLE `oliver` 65 | MODIFY `messages_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; 66 | COMMIT; 67 | 68 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 69 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 70 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 71 | -------------------------------------------------------------------------------- /MYSQL FILES/users_july.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.8.5 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Anamakine: 127.0.0.1 6 | -- Üretim Zamanı: 17 Tem 2019, 21:00:34 7 | -- Sunucu sürümü: 10.1.39-MariaDB 8 | -- PHP Sürümü: 7.3.5 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET AUTOCOMMIT = 0; 12 | START TRANSACTION; 13 | SET time_zone = "+00:00"; 14 | 15 | 16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19 | /*!40101 SET NAMES utf8mb4 */; 20 | 21 | -- 22 | -- Veritabanı: `phptutorial` 23 | -- 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Tablo için tablo yapısı `users_july` 29 | -- 30 | 31 | CREATE TABLE `users_july` ( 32 | `person_id` int(6) UNSIGNED NOT NULL, 33 | `person_fullname` varchar(30) NOT NULL, 34 | `person_email` varchar(30) NOT NULL, 35 | `person_username` varchar(30) NOT NULL, 36 | `person_password` varchar(30) NOT NULL 37 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 38 | 39 | -- 40 | -- Tablo döküm verisi `users_july` 41 | -- 42 | 43 | INSERT INTO `users_july` (`person_id`, `person_fullname`, `person_email`, `person_username`, `person_password`) VALUES 44 | (1, 'furkan gulsen', 'furkan@gmail.com', 'furkan', 'furkan123'), 45 | (2, 'oliver allen', 'oliver@gmail.com', 'oliver', 'oliver123'), 46 | (3, 'jack queen', 'jack@gmail.com', 'jack', 'jack123'); 47 | 48 | -- 49 | -- Dökümü yapılmış tablolar için indeksler 50 | -- 51 | 52 | -- 53 | -- Tablo için indeksler `users_july` 54 | -- 55 | ALTER TABLE `users_july` 56 | ADD PRIMARY KEY (`person_id`); 57 | 58 | -- 59 | -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri 60 | -- 61 | 62 | -- 63 | -- Tablo için AUTO_INCREMENT değeri `users_july` 64 | -- 65 | ALTER TABLE `users_july` 66 | MODIFY `person_id` int(6) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 67 | COMMIT; 68 | 69 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 70 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 71 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phpEmailSystem 2 | Simple PHP Email System 3 | 4 | 5 | **Used technologies:** 6 | 7 | - HTML 8 | - CSS 9 | - JAVASCRIPT 10 | - PHP 11 | - MYSQL 12 | - phpmyadmin 13 | 14 | I designed a simple mail system from this project. In this mail system, I checked the features of adding, deleting and changing data via mysql using PHP's PDO structure. 15 | 16 | --- 17 | 18 | > I made this project while learning php. So I may have a certain mistake. You can help me by doing the following tasks or correcting the code here. 19 | 20 | - [ ] Find and fix vulnerabilities in the login and registration sections. 21 | - [x] Add the "remember me" option to the login section and code it accordingly. 22 | - [ ] Include a page with sent emails. 23 | - [ ] Add delete feature to sent and received messages in database. 24 | - [ ] Write an algorithm that detects spam messages. 25 | - [ ] Add a page that contains spam messages. 26 | -------------------------------------------------------------------------------- /add.php: -------------------------------------------------------------------------------- 1 | query('SELECT * FROM users_july',PDO::FETCH_ASSOC); 14 | if($getData){ 15 | foreach($getData as $data){ 16 | $dat[] = $data; 17 | }; 18 | }; 19 | for($i=0;$iprepare('INSERT INTO users_july(person_fullname,person_email,person_username,person_password) 39 | VALUES(:person_fullname,:person_email,:person_username,:person_password)'); 40 | $execute->bindParam(':person_fullname',$fullname,PDO::PARAM_STR); 41 | $execute->bindParam(':person_email',$email,PDO::PARAM_STR); 42 | $execute->bindParam(':person_username',$username,PDO::PARAM_STR); 43 | $execute->bindParam(':person_password',$password,PDO::PARAM_STR); 44 | $execute->execute(); 45 | if($execute){ 46 | $_SESSION['username'] = $username; 47 | header("Location: createTable.php"); 48 | echo 'başarılı'; 49 | }else{ 50 | echo 'başarısız'; 51 | }; 52 | 53 | } 54 | 55 | $db = null; 56 | 57 | 58 | 59 | ?> -------------------------------------------------------------------------------- /connect.php: -------------------------------------------------------------------------------- 1 | '; 7 | echo $e->getMessage(); 8 | die(); 9 | }; 10 | 11 | ?> -------------------------------------------------------------------------------- /createTable.php: -------------------------------------------------------------------------------- 1 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 16 | 17 | $sqlQuery = "CREATE TABLE $cookie ( 18 | messages_id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, 19 | messages_sender VARCHAR(100) NOT NULL, 20 | messages_content VARCHAR(5000) NOT NULL, 21 | messages_date TIMESTAMP 22 | )"; 23 | 24 | $connection->exec($sqlQuery); 25 | 26 | } 27 | catch(PDOException $e){ 28 | $sqlQuery . "
" . $e->getMessage(); 29 | }; 30 | 31 | $db = null; 32 | session_destroy(); 33 | header('Location: index.php'); 34 | ?> -------------------------------------------------------------------------------- /homepage/homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Document 11 | 12 | 13 | 14 | 15 |
16 | LOGIN 17 | REGISTER 18 |
19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /loginPage/login.php: -------------------------------------------------------------------------------- 1 | 2 | prepare('SELECT * FROM users_july'); 13 | $getData->execute(); 14 | $values = $getData->fetchAll(PDO::FETCH_ASSOC); 15 | 16 | foreach( $values as $val){ 17 | 18 | // ------------------VERI KONTROLLERI---------------- 19 | // print_r($val['person_username']); 20 | // print_r($val['person_password']); 21 | // echo 'getControl: ' . $getControl['person_password'] . '
'; 22 | // echo 'password: ' . $password . '
'; 23 | 24 | $control = $db->prepare('SELECT person_password FROM users_july WHERE person_username = ?'); 25 | $control->execute(array($val['person_username'])); 26 | $getControl= $control->fetch(PDO::FETCH_ASSOC); 27 | 28 | // Burada form'dan gelen kullanıcı adı ile mysql database'in içinde eşleştirme arıyoruz... 29 | if($username === $val['person_username']){ 30 | if(!empty($_POST["remember_me"])) 31 | { 32 | $hour = time() + 3600 * 24 * 30; 33 | setcookie('username', $username, $hour); 34 | setcookie('password', $password, $hour); 35 | }else{ 36 | 37 | setcookie('username', ""); 38 | setcookie('password', ""); 39 | 40 | } 41 | if($password == $getControl['person_password']){ 42 | $_SESSION['person'] = ['username' => $val['person_username'], 'email' => $val['person_email']]; 43 | header('Location: index.php?page=mail'); 44 | }else{ 45 | echo 'Password is incorrect'; 46 | } 47 | }else{ 48 | echo 'The user name or password is incorrect'; 49 | } 50 | } 51 | } 52 | 53 | $db=null; 54 | 55 | ?> 56 | 57 | 58 |
59 | 60 | 65 | 66 | 70 |
71 | 74 | 77 |
78 | 82 | 83 | 87 | 88 | 89 | 102 |
103 | BACK 104 |
105 | 106 | -------------------------------------------------------------------------------- /navbar.php: -------------------------------------------------------------------------------- 1 |
2 |

CODEBLOGGER

3 | 4 | 11 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /pages/Inbox.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM $session_username",PDO::FETCH_ASSOC); 11 | ?> 12 | 13 |
14 | 18 | 19 | 23 |
24 | 25 | query("SELECT * FROM $session_username",PDO::FETCH_ASSOC); 27 | if($myTable): 28 | foreach($myTable as $val): ?> 29 | 30 | 31 |
32 |

33 |

34 |

35 |
36 |

37 |
38 | 39 | 40 | 45 | 46 | 47 | 48 | 64 | 65 | -------------------------------------------------------------------------------- /pages/newMessage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 10 | 11 | 14 | 15 | query('SELECT * FROM users_july',PDO::FETCH_ASSOC); 29 | $emailForUsername = []; 30 | $data = []; 31 | if($allTable){ 32 | foreach($allTable as $val){ 33 | $data[] = $val; 34 | $emailForUsername[$val['person_email']] = $val['person_username']; 35 | }; 36 | }; 37 | 38 | 39 | if(isset($formEmail)){ 40 | for($i=0;$iprepare("INSERT INTO $setUsername(header,messages_sender,messages_content) 46 | VALUES(:header,:messages_sender,:messages_content)"); 47 | $setData->bindParam(':header',$messages_header, PDO::PARAM_STR); 48 | $setData->bindParam(':messages_sender',$session_email, PDO::PARAM_STR); 49 | $setData->bindParam(':messages_content',$messages_content, PDO::PARAM_STR); 50 | $setData->execute(); 51 | } 52 | }; 53 | } 54 | 55 | ?> 56 | 57 | 58 |
59 |
60 |
61 |
62 | 63 |
64 |
65 | 66 |
67 |
68 |
69 |
70 | 71 |
72 |
73 | 74 |
75 |
76 |
77 |
78 | 79 |
80 |
81 | 82 |
83 |
84 |
85 | 86 |
87 |
88 |
89 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /register/register.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 |
7 | 8 | BACK 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /styleFile/inbox.css: -------------------------------------------------------------------------------- 1 | * {box-sizing: border-box} 2 | body {font-family: "Lato", sans-serif; overflow: hidden;} 3 | 4 | /* Style the tab */ 5 | .tab { 6 | float: left; 7 | border: none; 8 | background-color: #CB7C74; 9 | width: 25%; 10 | height: 90%; 11 | } 12 | 13 | /* Style the buttons inside the tab */ 14 | .tab button { 15 | display: block; 16 | background-color: inherit; 17 | color: black; 18 | padding: 22px 16px; 19 | width: 100%; 20 | border: none; 21 | outline: none; 22 | text-align: left; 23 | cursor: pointer; 24 | transition: 0.3s; 25 | font-size: 17px; 26 | border-bottom: 2px solid rgba(0,0,0,.5); 27 | box-sizing: border-box 28 | } 29 | 30 | h1{ 31 | float: left; 32 | font-weight: bold; 33 | } 34 | 35 | h4{ 36 | float: right; 37 | } 38 | 39 | p,hr{ 40 | clear: both; 41 | } 42 | 43 | /* Change background color of buttons on hover */ 44 | .tab button:hover { 45 | background-color: #ddd; 46 | } 47 | 48 | /* Create an active/current "tab button" class */ 49 | .tab button.active { 50 | background-color: #ccc; 51 | } 52 | 53 | /* Style the tab content */ 54 | .tabcontent { 55 | display: none; 56 | float: left; 57 | padding: 0px 12px; 58 | width: 70%; 59 | border-left: none; 60 | height: 100%; 61 | } -------------------------------------------------------------------------------- /styleFile/navbar.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --background: #900C3F; 3 | } 4 | *, 5 | *::before, 6 | *::after { 7 | box-sizing: border-box; 8 | } 9 | body { 10 | margin: 0; 11 | background: #fff; 12 | font-family: "Work Sans", sans-serif; 13 | font-weight: 400; 14 | } 15 | 16 | 17 | /* navigation styles start here */ 18 | header { 19 | background: var(--background); 20 | text-align: center; 21 | position: relative; 22 | z-index: 999; 23 | width: 100%; 24 | } 25 | 26 | .nav-toggle { 27 | display: none; 28 | } 29 | .nav-toggle-label { 30 | position: absolute; 31 | top: 0%; 32 | left: 0; 33 | margin-left: 1em; 34 | height: 100%; 35 | display: flex; 36 | align-items: center; 37 | } 38 | .nav-toggle-label span, 39 | .nav-toggle-label span::before, 40 | .nav-toggle-label span::after { 41 | display: block; 42 | background: white; 43 | height: 2px; 44 | width: 2em; 45 | border-radius: 2px; 46 | position: relative; 47 | } 48 | .nav-toggle-label span::before, 49 | .nav-toggle-label span::after { 50 | content: ""; 51 | position: absolute; 52 | } 53 | .nav-toggle-label span::before { 54 | bottom: 7px; 55 | } 56 | .nav-toggle-label span::after { 57 | top: 7px; 58 | } 59 | 60 | nav { 61 | position: absolute; 62 | text-align: left; 63 | top: 100%; 64 | left: 0%; 65 | background: var(--background); 66 | width: 100%; 67 | transform: scale(1, 0); 68 | transform-origin: top; 69 | transition: transform 400ms ease-in-out; 70 | } 71 | nav ul { 72 | margin: 0; 73 | padding: 0; 74 | list-style: none; 75 | } 76 | nav li { 77 | margin-bottom: 1em; 78 | margin-left: 1em; 79 | } 80 | nav a { 81 | color: white; 82 | text-decoration: none; 83 | font-size: 1.2rem; 84 | text-transform: uppercase; 85 | opacity: 0; 86 | transition: opacity 150ms ease-in-out; 87 | } 88 | nav a:hover { 89 | color: #000; 90 | } 91 | .nav-toggle:checked ~ nav { 92 | transform: scale(1, 1); 93 | } 94 | .nav-toggle:checked ~ nav a { 95 | opacity: 1; 96 | transition: opacity 250ms ease-in-out 250ms; 97 | } 98 | 99 | @media screen and (min-width: 800px) { 100 | .nav-toggle-label { 101 | display: none; 102 | } 103 | 104 | header { 105 | display: grid; 106 | grid-template-columns: 1fr auto minmax(600px, 3fr) 1fr; 107 | } 108 | .logo { 109 | color: #ccc; 110 | grid-column: 2 / 3; 111 | } 112 | nav { 113 | all: unset; 114 | grid-column: 3/4; 115 | display: flex; 116 | justify-content: flex-end; 117 | align-items: center; 118 | } 119 | nav ul { 120 | display: flex; 121 | } 122 | nav li { 123 | margin-left: 3em; 124 | margin-bottom: 0; 125 | } 126 | nav a { 127 | opacity: 1; 128 | position: relative; 129 | } 130 | 131 | nav a::before { 132 | content: ""; 133 | display: block; 134 | height: 5px; 135 | background: black; 136 | position: absolute; 137 | top: -0.75em; 138 | /*or the line in the bottom 139 | bottom: -0.75em; 140 | not top*/ 141 | left: 0; 142 | right: 0; 143 | transform: scale(0, 1); 144 | /*growing from the left and not from the middle 145 | transform-origin: left;*/ 146 | transition: transform ease-in-out 250ms; 147 | } 148 | 149 | nav a:hover::before { 150 | transform: scale(1, 1); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /styleFile/newMessage.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | input[type=text], select, textarea { 6 | width: 100%; 7 | padding: 12px; 8 | border: 1px solid #ccc; 9 | border-radius: 4px; 10 | resize: vertical; 11 | } 12 | 13 | label { 14 | padding: 12px 12px 12px 0; 15 | display: inline-block; 16 | } 17 | 18 | input[type=submit] { 19 | background-color: #900C3F; 20 | color: white; 21 | padding: 12px 20px; 22 | border: none; 23 | border-radius: 4px; 24 | cursor: pointer; 25 | width: 100%; 26 | margin-top: 20px; 27 | transition: .5s; 28 | font-size: 20px; 29 | } 30 | 31 | input[type=submit]:hover { 32 | background-color: black; 33 | } 34 | 35 | .container { 36 | border-radius: 5px; 37 | padding: 20px; 38 | } 39 | 40 | .col-25 { 41 | float: left; 42 | width: 25%; 43 | margin-top: 6px; 44 | } 45 | 46 | .col-75 { 47 | float: left; 48 | width: 75%; 49 | margin-top: 6px; 50 | } 51 | 52 | /* Clear floats after the columns */ 53 | .row:after { 54 | content: ""; 55 | display: table; 56 | clear: both; 57 | } 58 | 59 | /* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */ 60 | @media screen and (max-width: 600px) { 61 | .col-25, .col-75, input[type=submit] { 62 | width: 100%; 63 | margin-top: 0; 64 | } 65 | } -------------------------------------------------------------------------------- /styleFile/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background:url("https://images.unsplash.com/photo-1460355976672-71c3f0a4bdac?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80"); 3 | background-size:cover; 4 | background-position: top right; 5 | 6 | } 7 | .box{ 8 | width:400px; 9 | height:50px; 10 | text-align:center; 11 | position:absolute; 12 | top:50%; 13 | left:50%; 14 | transform:translate(-50%,-50%); 15 | } 16 | .box a{ 17 | font-size:24px;margin-right:20px 18 | } 19 | #form{ 20 | width: 400px; 21 | height: 200px; 22 | position: absolute; 23 | top: 50%; 24 | left: 50%; 25 | transform: translate(-50%,-50%); 26 | } 27 | #form input{ 28 | padding: 10px 15px; 29 | border-radius: 5px; 30 | width: 100%; 31 | box-sizing: border-box; 32 | border: none; 33 | font-size: 20px; 34 | outline: none; 35 | color: #262626; 36 | margin-bottom: 10px; 37 | text-align: center; 38 | } 39 | #form button{ 40 | width: 100%; 41 | padding: 10px 15px; 42 | font-size: 20px; 43 | background: mediumslateblue; 44 | color: #262626; 45 | border: none; 46 | font-weight: bold; 47 | } 48 | #form a{ 49 | display: block; 50 | text-align: center; 51 | font-size: 16px; 52 | color: #ccc; 53 | text-decoration: none; 54 | position: relative; 55 | margin-top: 12px; 56 | opacity: .75; 57 | 58 | } 59 | #form label{ 60 | display: inline-block; 61 | color: rgba(255,255,255,.5); 62 | } 63 | #form label input{ 64 | border-radius: 5px; 65 | width: 20px; 66 | } 67 | --------------------------------------------------------------------------------