Hi
I've got a Dynamic Table from Mysql, the table has two columns "number" and "name", I want to add an onclick button (Return to home) at the end of the table, I put the onclick button at the end of the php code but the button appears at the top of the page, this my code:
Any ideas?
Thanks!!!
I've got a Dynamic Table from Mysql, the table has two columns "number" and "name", I want to add an onclick button (Return to home) at the end of the table, I put the onclick button at the end of the php code but the button appears at the top of the page, this my code:
Code:
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<?php
//Mysql Conne.
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
//Select DB
mysql_select_db("calls", $con);
//Query
$query1 = "SELECT *".
"FROM numberlist ".
"ORDER BY name ";
$result1 = mysql_query($query1) or die(mysql_error());
/* Show Table */
echo "<table border=1 cellpadding=4 cellspacing=0>";
/*Heading*/
echo "<tr>
<th colspan=2> Number List</th>
<tr>
<tr>
<th> Number </th><th> Name</th>";
while($row1 = mysql_fetch_array($result1))
{
echo "<tr>
<td> $row1[number] </td>
<td> $row1[name] </td>
</tr>";
}
?>
<input name="Submit" type="submit" onclick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="Home" />
Any ideas?
Thanks!!!