calculating values from input, in PHP
<p>I'm studying for finals and i came across this question:</p>

<blockquote>
  <p>Write a php script to read a positive integer, n from a input box and calculate the value of 1+2+-- n...</p>
</blockquote>

<p>ive have tried for long  and done sufficient research, but i have not been able to complete this so far i have:</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;
     &lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;form action="inputnum.php" method="post" &gt;
   num:&lt;input type="text" name="num" size ="5"/&gt;
  &lt;input type = "submit" value = "Submit Order" /&gt;

       &lt;?php
        $num=$_POST["num"];
        if ($num==0)$num=="";
         for($i=0; $i&lt;=$num; $i++){
         }
            echo"($num+$i)";
       ?&gt;

  &lt;/form&gt;
</code></pre>

<p>
 </p>

<p>can anyone help me out?
Thanks in advance!</p>
