I'm studying for finals and i came across this question:
Write a php script to read a positive integer, n from a input box and calculate the value of 1+2+-- n...
ive have tried for long and done sufficient research, but i have not been able to complete this so far i have:
<html>
<head>
<title>
</title>
</head>
<body>
<form action="inputnum.php" method="post" >
num:<input type="text" name="num" size ="5"/>
<input type = "submit" value = "Submit Order" />
<?php
$num=$_POST["num"];
if ($num==0)$num=="";
for($i=0; $i<=$num; $i++){
}
echo"($num+$i)";
?>
</form>
can anyone help me out? Thanks in advance!