Dtp1337 Posted October 3, 2012 Share Posted October 3, 2012 (edited) Can anyone help me get this first part of my program to work. My form sends Start, End, and Increment... <?php $Start=$_GET["Start"]; $End=$_GET["End"]; $Increment=$_GET["Increment"]; if ($Increment < 0) { if($Start<=$End) { $inc = $Start; echo "<p> Start: $Start </p> \n"; While ($Start <= $End) { <------------ This loop needs to display inbetween output $Start/$End and increment from start to end. echo "<p>Increment = $inc</p> \n"; $inc = $inc + $Increment; echo "<p> Increment: $inc </p> \n"; } echo "<p> End: $End </p> \n"; }else { echo "<p><b> ERROR# The Starting Integer is greater then the Ending Integer. <b></p>" ; } } else { echo "<p><b> ERROR# Your increment number used is a negative. <b></p>" ; } ?> Edited October 3, 2012 by Dtp1337 Link to comment Share on other sites More sharing options...
JamesB Posted October 3, 2012 Share Posted October 3, 2012 try changing $Start to $inc in: While ($Start <= $End) { as $inc is the variable being changed inside the loop. Link to comment Share on other sites More sharing options...
Dtp1337 Posted October 4, 2012 Author Share Posted October 4, 2012 AH thank you sir. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now