Skip to content

ahmmedimtiaz/Quote-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Quote Generator

Overview

The Random Quote Generator is a simple web application that displays a randomly selected quote each time the user requests a new one. It is implemented in PHP and includes basic styling with CSS. The quotes are stored in a separate file named quotes.txt.

File Structure

  • index.php: The main PHP script that generates and displays random quotes.
  • style.css: The stylesheet defining the visual appearance of the web page.
  • quotes.txt: A file containing a list of quotes.

How to Use

  1. Install PHP: Ensure you have PHP installed on your server.
  2. Create a Quotes File: Create a quotes.txt file with a list of quotes. Each quote should be on a new line.
  3. Update Site Header: Open index.php in a text editor and replace the site header with your desired site name.
  4. View the Generator: Open index.php in a web browser to view the random quote generator.

Styles and Design

The visual style of the Random Quote Generator is defined in the style.css file. It uses a simple color scheme, a readable font, and a responsive layout for different screen sizes. The header is fixed at the top of the page, and the main quote container has a maximum width for a clean presentation.

JavaScript Functionality

The JavaScript functionality is minimal, with a single function getNewQuote() that reloads the page when the "Get New Quote" button is clicked. This triggers the PHP script to generate and display a new random quote.

Live Site

Visit the live Random Quote Generator at https://php.ahmmedimtiaz.com/quote-generator/

Contact Information

For any inquiries or further assistance, please feel free to contact me: