I need advice re mysqli dropdown

Joined
Sep 21, 2016
Messages
1
Reaction score
0
Hi, I've been trying to code up a file to create a mysqli dropdown displaying records from a database, link to a record ("target", a URL (www.xxxxxxx), by clicking on it.
I'm also playing with condional coloring. Any suggestions(be nice lol) will be appreciated. Thanks in advance. This is my pastime.

<!DOCTYPE HTML><html>
<head>
<script language="Javascript" type="text/javascript">
function gotolink()
{
var destination= self.location;

for(var i = 0; i<document.form.radiobutton.length; i++)
{
if(document.radioform.radiobutton.checked)
{ destination=document.radioformform.radiobutton.value }
}
window.location = destination;
}
</script>

</head>
<body><center><b>Email List<br>
<form id="radioform" name="radioform" action="" method="post"
accept-charset="UTF-8">

<?php
include('mysqli-connect.php');
$query = "UPDATE emailtbl SET date-time='DATE()', visitcount='visitcount + 1'";
$result = mysql_query($query) OR die(mysql_error());
echo "Data successfully updated";

$query = "SELECT target, username, password, purpose, emailused, date-time, visitcount, saved FROM emailtbl ORDER BY target ASC";

<table border="1" cellspacing="2" cellpadding="2"> // Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\xxx on line xx
<tr>
<td>target</td><td>username</td><td>password</td><td>purpose</td>
<td>emailused</td><td>date-time</td><td>visitcount</td><td>saved</td>
</tr>
while($res=mysql_fetch_assoc($result))
{
$counter=$counter + "1";
if($counter=="1")
{ echo "<tr bgcolor='#FFD4FF'>"; }
if($counter=="2")
{ echo "<tr bgcolor='#ccffff'>"; $counter=$counter - "2"; }
echo <td>";
echo "<input type=\"radio\" name=\"select\"onclick=\"window.open('$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['purpose'];echo "</td>";
echo "<td>";echo $res['date-time'];echo "</td>";
echo "<td>";echo $res['visitcount'];echo "</td>";
echo "<td>";echo $res['saved'];echo "</td>";
echo "</tr>";
echo "</table>";
}
mysql_close();
}
?>
</form></body></html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,704
Messages
2,569,334
Members
44,617
Latest member
ConcettaTa

Latest Threads

Top