Jump to content

Recommended Posts

somebody once told me in this forum that i can't create a good calculator with php, but i've been trying my best to prove the critics wrong, and in my effort to do so i have written a front view of how the calculator will look like but the problem is am new to php dont have an idea of how to extract the value from the clicking of a number and dont know how to go about with coding php this is the front view

<table border ="5">
<table border="2">
<th><input type="text" name="num" size="23" ></th>
</table>
<table border="3">
<tr>
<td><button size="0">+</button></td>
<td><button width="0"> - </button></td>
<td><button>*</button></td>
<td><button>/</button></td>
</tr>
<tr>
<td><button>-></button></td>
<td><button>1</button></td>
<td><button>2</button></td>
<td><button>3</button></td>
</tr>
<tr>
<td><button>4</button></td>
<td><button>5</button></td>
<td><button>6</button></td>
<td><button>7</button></td>
</tr>
<tr>
<td><button>8</button></td>
<td><button>9</button></td>
<td><button>0</button></td>
<td><button>=</button></td>
</tr>
<tr>
<td><button>.</button></td>
<td><button>%</button></td>
<td><button>^</button></td>
<td><button>!</button></td>
</tr>
</table>
</table>

 

 

please help out

Edited by stutego

You're better off writing a calculator in Javascript - so I'm agreeing with the critics. Due to the RESTful nature of the web your calculator (client) has to send requests to the calculator processing pages (server) every time you want to make a calculation i.e. the page has to refresh every time you click a button and store what you clicked somewhere for use later. That in itself is a nightmare.

 

You'd find it easier, in my honest opinion, to use Javascript.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.