Google Login with Google

Adding gallery.php How to

1. Create the file

Create a new file called gallery.php in your project root (/hosting/foliocraft/html/).

2. Basic structure

php<?php

require_once 'auth.php';

require_once 'db.php';

include 'header.php';



// Fetch all gallery items

$result = $conn->query("SELECT * FROM gallery ORDER BY id DESC");

?>

3. Database table

Run this in phpMyAdmin → SQL tab:

sqlCREATE TABLE gallery (

id INT AUTO_INCREMENT PRIMARY KEY,

title VARCHAR(255) NOT NULL,

image_url VARCHAR(500) NOT NULL,

caption TEXT,

user_id INT,

username VARCHAR(100),

created_at DATETIME DEFAULT CURRENT_TIMESTAMP

);

4. Add to navigation

In your header.php, add a link:

html<a href="gallery.php">Gallery</a>

Hope this can help you.
← Back to list
💬 Comments (1)
전혜주
전혜주 Apr 27, 2026 · 12:33
This is good tips for getting knowledge about how to make a gallery for oneself's website! Take this advice as a guidance. Follow the rules, then you will success!