CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, Fhalcon, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Thu Jul 09, 2020 3:29 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: php radio button link
PostPosted: Mon Jul 22, 2019 11:45 pm 

Joined: Tue May 29, 2018 3:36 am
Posts: 3
Hi, my objective is to list database rows and by clicking one of the
radio buttons in the report, link to the url displayed on that line.
My code follows. I will surely appreciate your input. Thanks
<!DOCTYPE html><html>
<head><title>Email Visits</title></head>
<form id="testform" name="testform" action="" method="post"

$host="localhost"; $username="root"; $password="cookie";
$db_name="homedb"; $tbl_name="emailtbl";

/* Connect to server and select databse */
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// Define $count
$count = "";

$sql="SELECT * FROM emailtbl ORDER BY target ASC";

echo '<table border="1" cellspacing="0">';
// Add 1 to the row count
    $count=$count + "1";

/* -------------If $count==1 table row color = FFD4FF ----------*/
    { echo "<tr bgcolor='FFD4FF'>"; }

/* -------------If $count==2 table row color = #ccffff ----------*/
    { echo "<tr bgcolor='ccffff'>"; $count=$count - "2"; }
echo "<td>";

// echo "<input type=\"radio\" name=\"select\"onclick=\"'$res


echo "<input type=\"radio\" name=\"select\"value=\"{$res['target']}\">";
echo "</td>";
echo "<td>";echo $res['target'];echo "</td>";
echo "<td>";echo $res['username'];echo "</td>";
echo "<td>";echo $res['password'];echo "</td>";
echo "<td>";echo $res['emailused'];echo "</td>";
echo "<td>";echo $res['lastused'];echo "</td>";
echo "<td>";echo $res['purpose'];echo "</td>";
echo "<td>";echo $res['visits'];echo "</td>";
echo "<td>";echo $res['saved'];echo "</td>";

/* echo "</tr>";
echo '</table>';
  </table> </form></body></html>

echo "</tr>" . PHP_EOL;

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 13 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2016 phpBB Group