Question: I want to open a new window for each $url created how could I do that?

```
<?php
require_once('sql.php');

$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");

while($row = mysql_fetch_array($result)){
    // Prepare gamertag for url
    $gamertag = strtolower($row['gamertag']);
    $url = "http://halogamertags.com/tags/index.php?player_name=".urlencode($gamertag);
}
?>

```

Answer: 
you can do it with a combo of javascript and ur current script:

```
<?php
require_once('sql.php');

$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
echo "<script>";
while($row = mysql_fetch_array($result)){
    // Prepare gamertag for url
    $gamertag = strtolower($row['gamertag']);
    $url = "http://halogamertags.com/tags/index.php?player_name=".urlencode($gamertag);
    echo "window.open('$url');".PHP_EOL;
}
echo "</script>";
?>

```
**Warning ~ Will attempt to open 10 windows on load:**

**[Live Demo](http://jsfiddle.net/zhehg/)** 

```
$("#gamertags a").each(function() {
    window.open($(this).attr('href'), 'Player Details', 'width=500,height=500');
});

```