Welcome visitor
* Login
* Register
It is currently September 18th, 2019, 12:32 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  Cycle in Html
PostPosted: February 4th, 2009, 12:01 am 
User avatar

Posts: 34
Well, I'm not sure if this is possible, but I really need to create a cycle to show on the screen a bunch of times an specific line. Is there any way to save all the time of doing it all by myself??

-thanx-


Top
 Profile  
 
  Re: Cycle in Html
PostPosted: February 4th, 2009, 12:26 am 
User avatar

Posts: 40
Hmm, no, it isn't possible on Hmtl alone. The reason is that .html is for client-side usage, which means, it manages how and not what information is going to be displayed on the screen. But you can use a .php file to help you with the loop. Here's an example for it using a while cycle:

<?php
$i=1;//this is the counter
while ($i<=100){
echo 'Your line. ';
$i++;//this is to increase the counter
}
?>


Just remember that because this is a php file, you will need to open it through your browser from the server, or else it wont work.


Top
 Profile  
 
  Re: Cycle in Html
PostPosted: February 5th, 2009, 9:02 pm 

Posts: 117
Also, a more html, or client side, way to do it would be implementing a JavaScript lines. Using the same 'for' loop would be like this:
<body>
<script type="text/javascript">
var i=1;
for (i=1;i<=100;i++)
{
document.write("/*your text*/");
}
</script>
</body>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron