|
-
Mar 17th, 2007, 08:45 PM
#1
Thread Starter
New Member
Looping Error
I have PHP loop. When I execute the page is blank. Why 
[quote]
echo(<?php for ($x = 1; $x < 1000; $x++) ?>)
{
<form onsubmit="echo($x) > // submit form each
</form>
}
-
Mar 17th, 2007, 09:52 PM
#2
Re: Looping Error
uhh. probably because that isn't even close to having the correct syntax for a for() loop? the code you posted wouldn't even run.
PHP Code:
<?php for($i = 1; $i < 1000; $i++){ ?>
<form onsubmit="<?php echo $i; ?>">
</form>
<?php } ?>
besides, even if you did run the script above, you're only printing the <form> tag. the <form> tag has no visual features, so it will always result in a blank page. you'd have to actually print out text for the script to have anything visible on a web browser when run. that is, unless you actually planned on having the random echo and curly brackets outside of the form in the first place (but I can't imagine why).
and you do realize printing out 1000 different forms isn't really going to do much, right? I can only hope that you're just doing this to test how the for() loop works? 1000 a little much, though.
-
Mar 17th, 2007, 10:27 PM
#3
Re: Looping Error
I suggest you take a course in programming. We can help you with specific problems, but we can't teach you everything, nor can we do your work for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|