I have here the code for making a mysql result a link using a javascript. But my problem is this, when i click that link it opens a new window and at the same time it also open a new tab. What i just want is that when i clicked the link it should only open a new window..can somebody please help me with it..
here the code..
public function dataview($query)
{
$stmt = $this->db->prepare($query );
$stmt->execute();
if($stmt->rowCount()>0)
{
while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td> ".$row['user_id']." </td>";
echo "<td> ".$row['username']." </td>";
echo '<td><a traget="_blank" onclick="pop_up(this)" href=VIEWSAMPLE.PHP?user_id='.$row["user_id"].'>'.$row["username"].'</a></td>';
echo "<td> ".$row['password']." </td>";
echo "</tr>";
}
}
else
{
echo "<tr>";
"<td>Nothing here...</td>";
"</tr>";
}
}
}
?>
and here the javascript
function pop_up(url){
window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=800,height=600,directories=no,location=no')
}