title: How To Make A Button On php that open a link in a new tab
body: <p>is there any way to make a button in php that open a link in a new tab?
  i have solve the problem by open iframes with the links
  but now i want to add on the top of the page a button to go back to home page
  how can i do that</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  $host="localhost"; // Host name 
  $username="publiadd_publix"; // Mysql username 
  $password="1a3g7893fsh"; // Mysql password 
  $db_name="publiadd_urlrotator"; // Database name 
  $tbl_name="url_rotator"; // Table name
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
       $query = 'SELECT * FROM url_rotator ORDER BY root_name DESC LIMIT 10';
       $result = mysql_query($query) or die("&lt;b&gt;A fatal MySQL error occured&lt;/b&gt;.&lt;br /&gt;Query: ".$query."&lt;br /&gt;Error: (".mysql_errno().") ".mysql_error());
  // Print Title
  
  print '&lt;center&gt;'."All Rotator In Our Network! ".'&lt;/center&gt;';
  print '&lt;center&gt;'."---------------------------".'&lt;/center&gt;';
       while ($row = mysql_fetch_assoc($result)) { 
            $id = $row['id'];
            $root_name = $row['root_name'];
            $root_url1 = $row['root_url1'];
            $root_url2 = $row['root_url2'];
            $root_url3 = $row['root_url3'];
            $root_url4 = $row['root_url4'];
            $root_url5 = $row['root_url5'];
            $root_url6 = $row['root_url6'];
            $root_url7 = $row['root_url7'];
            $root_url8 = $row['root_url8'];
            $root_url9 = $row['root_url9'];
            $root_url10 = $row['root_url10'];
  echo '&lt;center&gt;'.$row['id'] . " | " . $row['root_name'] . " | " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url1'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url2'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url3'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url4'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url5'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url6'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url7'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url8'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url9'] . " * " .'&lt;/center&gt;' ;
  echo '&lt;center&gt;'.$row['root_url10'] . " * " .'&lt;/center&gt;' ;
  echo  "&lt;iframe src=\"{$root_url1}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url2}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url3}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url4}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url5}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url6}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url7}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url8}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url9}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
  echo  "&lt;iframe src=\"{$root_url10}\" style=\"background: #fff;\" frameborder=\"0\" height=\"450\" scrolling=\"auto\" width=\"100%\"&gt;&lt;/iframe&gt;";
       }//end while
  // close MySQL connection 
  mysql_close();
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;meta http-equiv="refresh" content="&lt;?php echo $sec?&gt;;URL='&lt;?php echo $page?&gt;'"&gt;
  &lt;link rel="stylesheet" href="style.css" type="text/css" /&gt;
  //&lt;a href="&lt;?php echo $root_url10 ?&gt;"&gt;&lt;?php echo $root_url10 ?&gt;&lt;/a&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#ffffff"&gt;
  &lt;center&gt;&lt;br&gt;&lt;br&gt;&lt;form&gt;
  &lt;input type="button" value="Back" onclick="window.location.href='http://bitcoinrotator.publiadds.org.pt/login-registration/home.php'" /&gt;
  &lt;/form&gt;&lt;/center&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>