Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createSite() {
- if ($_GET['q'] == 'info' or !isset($_GET['q'])) {
- return createMainPage();
- } else if ($_GET['q'] == 'buy') {
- return "Infp";
- } else if ($_GET['q'] == 'about') {
- return "Info about company";
- } else {
- return "Error 404";
- }
- }
- <?php
- // Create info about product
- function createMainPage() {
- $database = mysqli_connect(
- "localhost", "root",
- "", "module3"
- );
- if (mysqli_connect_errno()) {
- echo "Не подключено!", mysqli_connect_errno(), ": ", mysqli_connect_error();
- exit();
- }
- $query = "SELECT * FROM info";
- $data = mysqli_fetch_all(
- mysqli_query($database, $query),
- MYSQLI_ASSOC
- );
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement