Hi guys, the below code creates my dropdown.
I select the record and submit and the selected record is displayed.
------------------------------------------------------------------
<!DOCTYPE><html><head><title>email menu</title></head>
<body><center>
<form name="form" method="post" action="">
<?php
// error_reporting(0);
error_reporting(E_ALL ^ E_NOTICE);
include 'homedb-connect.php';
//This creates the drop down box
echo "<select name= 'target'>";
echo '<option value="">'.'--- Select email account ---'.'</option>';
$query = mysqli_query($con,"SELECT target FROM lookuptbl");
$query_display = mysqli_query($con,"SELECT * FROM lookuptbl");
while($row=mysqli_fetch_array($query))
{echo "<option value='". $row['target']."'>".$row['target']
.'</option>';}
echo '</select>';
?>
<input type="submit" name="submit" value="Submit"/><!-- update "lastused" using selected "target"-->
</form></body></html>
<!DOCTYPE><html><head><title>email menu</title></head>
<body><center>
<?php
// error_reporting(0);
error_reporting(E_ALL ^ E_NOTICE);
include 'homedb-connect.php';
if(isset($_POST['target']))
{
$name = $_POST['target'];
$fetch="SELECT target, purpose, user, password, email, visits, date,
saved FROM lookuptbl WHERE target = '".$name."'";
$result = mysqli_query($con,$fetch);
if(!$result)
{echo "Error:".(mysqli_error($con));}
//display the table
echo '<table border="1">'.'<tr>'.'<td bgcolor="#ccffff align="center">'. 'Email menu'. '</td>'.'</tr>';
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'
<td bgcolor="#CFB53B>'.'target'.'</td>'.'
<td bgcolor="#ccffff>'.'purpose'. '</td>'.'
<td bgcolor="#ccffff>'.'user'.'</td>'.'
<td bgcolor="#ccffff>'.'password'.'</td>'.'
<td bgcolor="#ccffff>'.'email'.'</td>'.'
<td bgcolor="#CFB53B>'.'visits'. '</td>'.'
<td bgcolor="#CFB53B>'.'date'.'</td>'.'
<td bgcolor="#CFB53B>'. 'saved' .'</td>'.'</tr>';
while($data=mysqli_fetch_row($result))
{echo ("<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td>
<td>$data[4]</td><td>$data[5]</td><td>$data[6]</td><td>$data[7]</td></tr>");}
echo '</table>'.'</td>'.'</tr>'.'</table>';
}
?>
</body></html>
=========================================
but the headers
should be: target purpose user password email visits date saved
but are: purpose password visits saved
target,user,email,and date are skipped (every other heading is skipped)?
-----------------------------------------------
a screenshot is included to illustrate
--------------------------------------------
What's left after is that I want include a button to link to the target.
suggestions?
I select the record and submit and the selected record is displayed.
------------------------------------------------------------------
<!DOCTYPE><html><head><title>email menu</title></head>
<body><center>
<form name="form" method="post" action="">
<?php
// error_reporting(0);
error_reporting(E_ALL ^ E_NOTICE);
include 'homedb-connect.php';
//This creates the drop down box
echo "<select name= 'target'>";
echo '<option value="">'.'--- Select email account ---'.'</option>';
$query = mysqli_query($con,"SELECT target FROM lookuptbl");
$query_display = mysqli_query($con,"SELECT * FROM lookuptbl");
while($row=mysqli_fetch_array($query))
{echo "<option value='". $row['target']."'>".$row['target']
.'</option>';}
echo '</select>';
?>
<input type="submit" name="submit" value="Submit"/><!-- update "lastused" using selected "target"-->
</form></body></html>
<!DOCTYPE><html><head><title>email menu</title></head>
<body><center>
<?php
// error_reporting(0);
error_reporting(E_ALL ^ E_NOTICE);
include 'homedb-connect.php';
if(isset($_POST['target']))
{
$name = $_POST['target'];
$fetch="SELECT target, purpose, user, password, email, visits, date,
saved FROM lookuptbl WHERE target = '".$name."'";
$result = mysqli_query($con,$fetch);
if(!$result)
{echo "Error:".(mysqli_error($con));}
//display the table
echo '<table border="1">'.'<tr>'.'<td bgcolor="#ccffff align="center">'. 'Email menu'. '</td>'.'</tr>';
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'
<td bgcolor="#CFB53B>'.'target'.'</td>'.'
<td bgcolor="#ccffff>'.'purpose'. '</td>'.'
<td bgcolor="#ccffff>'.'user'.'</td>'.'
<td bgcolor="#ccffff>'.'password'.'</td>'.'
<td bgcolor="#ccffff>'.'email'.'</td>'.'
<td bgcolor="#CFB53B>'.'visits'. '</td>'.'
<td bgcolor="#CFB53B>'.'date'.'</td>'.'
<td bgcolor="#CFB53B>'. 'saved' .'</td>'.'</tr>';
while($data=mysqli_fetch_row($result))
{echo ("<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td>
<td>$data[4]</td><td>$data[5]</td><td>$data[6]</td><td>$data[7]</td></tr>");}
echo '</table>'.'</td>'.'</tr>'.'</table>';
}
?>
</body></html>
=========================================
but the headers
should be: target purpose user password email visits date saved
but are: purpose password visits saved
target,user,email,and date are skipped (every other heading is skipped)?
-----------------------------------------------
a screenshot is included to illustrate
--------------------------------------------
What's left after is that I want include a button to link to the target.
suggestions?