Skip to content

Simple calculator - created with HTML, PHP and CSS and made to look like a real calculator, with buttons, 2-display,etc. (No JS)

Notifications You must be signed in to change notification settings

kingcheche/simple-php-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-php-calculator

Simple calculator - created with HTML, PHP and CSS and made to look like a real calculator, with buttons, 2-display,etc. (No JS)

I noticed that most calculator created with PHP doesn't actually look and behave like a really calculator and I challenged myself to create something that will, I hoped to find something simple to just recreate, after doing my research, I was shocked that I couldn't find any one with just html and php, most of them were create with js, jqueryy, Ajax, and I wanted it to be purely PHP and at most HTML to create the form.

  • How does a regular PHP calculator look like?
  1. A form field to input data 1
  2. A form selection to choose the operation "+,-,/,*
  3. Another form field to input data 2
  4. Displayed answer after data is submitted
  5. Limited to have one calculation at a time

That is actually the basic of a calculator, but I wanted something that actually looked and feel like a calculator

How does a real calculator feel and look like? (The Goal)

  1. Data input by buttons
  2. Display that shows all the data together
  3. Display the shows the data as they are typed/clicked
  4. Actual looks of a calculator
  5. Freedom to input as much mathematical calculation expression, eg, " 5*5+8-8/2 "

Gladly all of my goal for the project was achieved and more, here are other goals that I was able to acheive

  1. Actual calculator look and feel
  2. Convert inputs from string to mathematical expression and output the answer
  3. Saves the question from display and shows it again white the answer below (2-display calculator)
  4. Write code to display error for various input that are natural not mathematical express, such as empty fields, syntax error, input error, etc
  5. Limit output to 12 characters
  6. And so much more that a simple calculator has

There are however something(s) I wish I could achieve

  1. Limit data input to 13 characters when inputting data by buttons (The limitation works when you input data by typing in the actual form - The top part of the display is an actual form field.

view live site here - https://cheche-php-calculator.herokuapp.com/ What do you think?

About

Simple calculator - created with HTML, PHP and CSS and made to look like a real calculator, with buttons, 2-display,etc. (No JS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published