wait.. one more thing.. can you teach me how to do line breaks like this: <?php statement statement statement ?> Code (markup): can anyone teach me to do that?
not trying to do anything.. like chikens wrote the code in a format , line breaking.. i want to learn where to give spaces.. <?php $thisPage="Home"; ?> <html> <head>......</head> <body> <?php if ($thisPage!="Home") { echo "<div class=\"footer\"> <a href='javascript:history.go(-1)'> [ Back ]</a> </div>"; } ?> </body> </html> Code (markup): look at this code.. he gave spaces before writing the code.. i want to learn this thing.
Oh I see.. He is just formatting the echo statement across several lines. If you don't end the statement with a ; PHP will keep reading the next line as if it were part of the same statement.
oh, he's formatting the block of code to make it easy to read. for example: <?php for($i=0;$i<10;++$i) { if ($i == 4) { echo "here's 4!"; $i++; } echo $i; } ?> PHP: Do you see what I mean? Indenting makes the code easy to see where the for statement and if statement start and end. When you have nested statements like that it can get complicated when your scripts are very complicated.
yep, that's pretty much all there is to it. just grouping the statements together inside your functions, for and while loops, and if statements