Page 1 of 1

Getting output from <input> and using it to display prime...

Posted: Thu Jan 22, 2009 12:21 am
by dudebodacious
Here is the code

Code: Select all

 
                    <form action="/FreewayApp/index.php" method="post">
                        <label>Start Number</label>
                        <input name="start" type="text" id="start" maxlength="10"></input>
                        <label>End Number</label>
                        <input name="stop" type="text" id="stop" maxlength="10"></input><br><br><br>
                        <label>Prime Integers</label><br>
                        <textarea name="output" id="outputA" rows="20" cols="50" maxlength="200" wrap="soft">
                            <?php 
                                for($x = _GET['start']; $x < _GET['stop']; $x++)
                                {   
                                    echo $x.', ';
                                }
                            ?>
                        </textarea><br>
                        <input type="submit" value="Find Primes" id="button"></input>
                    </form>
 
I am not sure how bad that code is above, could someone take a look and give me some pointers, to resources, etc. that might help me to solve this problem. I am trying to get input from the user from the two input boxes, and display all the numbers between those two numbers in a text area, ultimately I will only print out the prime numbers. I just need help on syntax.

Thank you,
Matthew Hoggan

Re: Getting output from <input> and using it to display prime...

Posted: Fri Jan 23, 2009 10:52 pm
by Popcorn
ummm.... what i see that you posted ...looks like you're missing "$" in "$_GET"