Shoutbox

Increasing links by a number - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Increasing links by a number (/showthread.php?tid=83426)

Increasing links by a number by tony on 04-27-2008 at 04:24 PM

Hello guys, anyone knows how to create an HTML page that does the following.

For example, i want to create links like this one (increasing one by one):

http://xxxxxx.com/rxxxx/AAA399495790
http://xxxxxx.com/rxxxx/AAA399495791
http://xxxxxx.com/rxxxx/AAA399495792
http://xxxxxx.com/rxxxx/AAA399495793

ETC ETC..


RE: Increasing links by a number by Jesus on 04-27-2008 at 04:52 PM

you can use javascript for that.
google for javascript innerhtml and you should find quite a few useful results.


RE: Increasing links by a number by Spunky on 04-27-2008 at 04:54 PM

A JavaScript for loop with document.write("linkurl.com/"+i); should do it shouldn't it?

EDIT: Beaten anyway :(


RE: Increasing links by a number by Jesus on 04-27-2008 at 05:01 PM

quote:
Originally posted by SpunkyLoveMuff
Beaten anyway
document.write may be easier indeed, depending on the site and what it's used for. ;)
RE: Increasing links by a number by Ezra on 04-27-2008 at 05:27 PM

Or use PHP but then you can't add more after it has processed.


RE: Increasing links by a number by tony on 04-27-2008 at 05:30 PM

Samples?


RE: Increasing links by a number by deAd on 04-27-2008 at 05:57 PM

Not sure if this is what you want, but this will display the first 50 numbers (if you use firefox you could put it all on one line and paste "javascript:<code>" into the address bar for it to show):

code:
var s = "";
var url = "http://xxxxxx.com/rxxxx/AAA";
var start = 399495790;
for(var i = 0; i < 50; i++) {
s += url + (start + i) + "<br/>";
}
document.write(s);

Change the 399495790 to change the first number it displays and the 50 to change how many it displays.
RE: Increasing links by a number by Jesus on 04-27-2008 at 06:07 PM

SLM's suggestion is probably the easiest way:

code:
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var i=1;
for (i=1; i<=10; i++)
{
document.write("<a href=\"http://www.yourwebsite.com/number" + i + "\">URL" + i + "</a><br>")
}
</script>
</body>
</html>

though google could have told you that, too...

edit: meh too slow:P
RE: Increasing links by a number by tony on 04-27-2008 at 06:28 PM

Thanks for your help, all of you. :)