How to do + or - in php?
<p>I want to have a form in following way:</p>

<pre><code>[-] [value] [+]
</code></pre>

<p>I don't know how to script the logic to get the value 1 higher or 1 lower in PHP.</p>

<p>I assumed something like following would work:</p>

<pre><code>&lt;?php

$i = 0;

if($_SERVER['REQUEST_METHOD'] == 'POST')
{
    if(isset($_POST['plus']))
    {
        $i++;
    }

    if(isset($_POST['min']))
    {
        $i--;
    }
}

?&gt;
</code></pre>

<p>and my form is as following:</p>

<pre><code>&lt;form action="" method="post"&gt;
    &lt;input type="submit" name="min" value="-"&gt; &lt;input type="text" value=&lt;?php echo $i ?&gt; &gt;         &lt;input type="submit" name="plus" value="+"&gt;
&lt;/form&gt;
</code></pre>

<p>But I'm only getting either a 1 or a -1. Can someone show me how to do this in a good way?</p>
