d.shankar Posted October 6, 2007 Share Posted October 6, 2007 I have this URL www.test.com/add.php?id=1 I want to make this URL to open multiple times like this (From the Address Bar) www.test.com/add.php?id=1 www.test.com/add.php?id=2 www.test.com/add.php?id=3 www.test.com/add.php?id=4 Is this possible ? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 6, 2007 Share Posted October 6, 2007 yes it is. run a for or a while loop, for is probably the best. for($i = 1; $i <= 4; $i++){ //set i to 1. the loop will stop at 4. and after each loop add 1 to i. echo "www.test.com/add.php?id={$i}"; } hope it helps. Quote Link to comment Share on other sites More sharing options...
d.shankar Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks dude but i have problem with that.. is it possible with JS ? Somewhat like this to be used in URL.. javascript:for(var i=0;i<10;i++){ window.open("www.test.com/add.php?id=i", "alert",); } Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 6, 2007 Share Posted October 6, 2007 it is possible. but when you do it like that, that would open 10 windows.. is that what you want? Quote Link to comment Share on other sites More sharing options...
d.shankar Posted October 6, 2007 Author Share Posted October 6, 2007 Yea no problem dude.. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 6, 2007 Share Posted October 6, 2007 lol.. well in that case then you would do it like this: function open_windows(){ for(var i=0;i<10;i++){ window.open("http://www.test.com/add.php?id="+i, "alert"); } } javascript:open_windows(); hope it helps Quote Link to comment Share on other sites More sharing options...
d.shankar Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks buddy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.