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>
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>