Skip to content

chouaib-629/calculator_php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Calculator

This is a simple calculator project built with PHP, HTML, CSS, and JavaScript. It allows users to perform basic arithmetic operations like addition, subtraction, multiplication, and division.

Features

  • User can input two numbers and select an operator.
  • The calculator performs the selected operation and displays the result.
  • Error handling for empty fields, non-numeric input, and division by zero.
  • Improved user interface and user experience with JavaScript enhancements.

Getting Started

To get a local copy of this project, follow these steps:

  1. Clone the repository:
git clone https://github.com/chouaib-629/calculator_php.git
  1. Navigate to the project directory:
cd calculator_php
  1. Open the index.php file in your preferred web browser.

Usage

To use the calculator, follow these steps:

  1. Enter the first number in the first input field.
  2. Select an operator from the dropdown menu.
  3. Enter the second number in the second input field.
  4. Click the "Calculate" button to see the result.

Project Structure

  • index.php: The main file containing the HTML, CSS, and PHP code for the calculator.
  • css/style_1.css: The default stylesheet for the calculator.
  • css/style_2.css: An alternative stylesheet with a different visual design.
  • css/style_3.css: Another alternative stylesheet with a unique visual design.
  • js/script.js: The JavaScript file containing code for enhanced user interface and experience.

Switching between Style`

To switch between the three available styles, simply update the link tag in the index.php file to point to the desired stylesheet. For example:

  • To use style_1.css, use:
<link rel="stylesheet" href="css/style_1.css">
  • To use style_2.css, use`
<link rel="stylesheet" href="css/style_2.css">
  • To use style_3.css, use:
<link rel="stylesheet" href="css/style_3.css">

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages