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>
}
Printable View
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>
}
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.
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).PHP Code:<?php for($i = 1; $i < 1000; $i++){ ?>
<form onsubmit="<?php echo $i; ?>">
</form>
<?php } ?>
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.
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.