Forum Moderators: coopster

Message Too Old, No Replies

checkbox in table

         

12Strings

8:18 pm on Feb 22, 2020 (gmt 0)

10+ Year Member



Hi, I use an HTML table to keep track of info such as usernames amd passwords. The field
"target" is a URL(www.example.com). has a button which when clicked takes me to the URL
see code below:
----------------------------------------------------------------------------------------
<td><input name="radiobutton" type="radio" value="https://community.example.org/f/"
onClick="gotolink()">www.community.example.org/f/</td>
<td>forums</td>
=========================================================================================

I've put this same data into a database to enable update, etc.. I want to use a button
or checkbox to do the same with the code below:
------------------------------------------------
<html>
<head>
<title> lookup table </title>
</head>
<body><b><center>
<h3>information table</h3>

<?php
$db_host = "localhost";$db_username = "root";$db_pass = "";$db_name = "homedb";
$db = new PDO('mysql:host='.$db_host.';dbname='.$db_name,$db_username,$db_pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$query = $db->query('SELECT * FROM lookuptbl');
?>
<table border=1>
<tr bgcolor="#ccfff">
<th>target</th>
<th>purpose</th>
<th>user</th>
<th>password</th>
<th>email</th>
<th>visits</th>
<th>lastdate</th>
<th>lasttime</th>
<th>saved?</th>
</tr>
<?php
while ($row = $query->fetch())
{
echo "<tr>";
echo "<td>" . $row['target'] . "</td>";
echo "<td>" . $row['purpose'] . "</td>";
echo "<td>" . $row['user'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['visits'] . "</td>";
echo "<td>" . $row['lastdate'] . "</td>";
echo "<td>" . $row['lasttime'] . "</td>";
echo "<td>" . $row['saved?'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</b></center></body></html>
========================================

[edited by: phranque at 1:59 am (utc) on Feb 23, 2020]
[edit reason] exemplified domains [/edit]

lammert

9:35 am on Feb 23, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld 12Strings!

Before fixing minor issues with your site like using a checkbox, I would first address a larger issue with your site. And that is that it stores and displays unencrypted user passwords. This may require a significant redesign of your process flow.