holyearth Posted October 14, 2006 Share Posted October 14, 2006 *****RESOLVED***** Quote Link to comment https://forums.phpfreaks.com/topic/23916-easy-php-question/ Share on other sites More sharing options...
trq Posted October 14, 2006 Share Posted October 14, 2006 Post your code and tell us what part your stuck on. Quote Link to comment https://forums.phpfreaks.com/topic/23916-easy-php-question/#findComment-108700 Share on other sites More sharing options...
.josh Posted October 14, 2006 Share Posted October 14, 2006 ...or go post in the freelance forum if you would rather someone do it for you. Quote Link to comment https://forums.phpfreaks.com/topic/23916-easy-php-question/#findComment-108727 Share on other sites More sharing options...
extrovertive Posted October 14, 2006 Share Posted October 14, 2006 //form.php[code=php:0]<form action="process.php" method="post" target="submit">Starting Number: <input type="text" name="startnum" /><br />Numbers: <input type="text" name="numbers" /><br /><select name="updown"> <option value="up">Increment</option> <option value="down">Decrement</option></select><br /><input type="submit" name="submit" value="Submit" /></form>[/code]//process.php[code=php:0]<?php$startnum = $_POST['startnum']; //starting number$numbers = $_POST['numbers']; //increment of$updown = $_POST['updown']; //increasing or decreasing$endnum = $startnum + $numbers; //ending number$num_array = ($updown == "up") ? range($startnum, $endnum) : range($endnum, $startnum); foreach($num_array as $key=>$val) { $urlstring .= "n" . ($key+1) . "=" . $val . "&"; } $urlstring = "submit.php?" . substr($urlstring, 0, -1);header("Location: $urlstring");?>[/code]//submit.phpWhatever goes here... Quote Link to comment https://forums.phpfreaks.com/topic/23916-easy-php-question/#findComment-108743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.