welcome to TSDN!
In order to help you, show all code you have developed so far. The code you showed does not include a <form> with a submit statement.
So let's see all of it and do not forget to include that code within the appropriate code tags!.. Please read the Posting Guidelines.
Ronald
<?php
include("conn.php");
$sel= mysql_select_db("sangoma");
//include("function.php");
?>
<div id="layout1">
<center>
<table border="0" cellpadding="1" cellspacing="1">
<form method='post' action='<?php $_SERVER[PHP_SELF] ?>' name='agentdisp'>
<tr>
<td align="right">Campaign Name:</td><td>
<?
$tab= $_GET['tab'];
$_SESSION['$t_tab']=$tab;
$r = mysql_query("show tables");
echo "<select name=tablename value=\'\' size=1 onchange=\"reload(this.form)\">";
echo "<option value=''>Table Name</option>";
while($res1 = mysql_fetch_row($r)) {
if($res1[0]==@$tab){
echo "<option selected value='$tab'>$tab</option>"."<BR>";
}else{
echo "<option value='$res1[0]'>$res1[0]</option>";}
}
echo "</select>";
?>
</td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="Submit" class="butt" /></td></tr>
</form>
</table>
</center>
<?
$submit=$_POST['submit'];
if($submit=='Submit')
{
//mysql_query("delete from sangomatemp.temp") or die(mysql_error());
$ttablename = $_POST{'tablename'};
/*echo"<table border=0 cellpading=0 cellspacing=0>";
echo"<td>phone</td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td></td>";
echo"<td>l</td></tr>";*/
echo "<table border=1 align=center id='thetable'>
<tr><td class='th'>Select</td><td class='th'>SKU #</td><td class='th'>Description</td><td class='th'>List Price with Customs</td></tr>";
//$q="select phone from newtest where phone<>''";
//$q1=mysql_query($q) or die("could not connect".mysql_error());
echo $ttablename;
$sql=mysql_query("select * from $ttablename") or die(mysql_error());
while($row=mysql_fetch_row($sql))
{
echo"<tr>
<td><input type='checkbox' name='arr[]'></td>
<td >$row[0]</td>
<td>$row[1]</td>
<td>$row[2]</td>
</tr>";
}
echo "</table>";
echo"<table border=0 cellspacing=0 cellspadding=0>";
echo"<input type='submit' name='submit' value='Submit' />";
//echo "<tr><td><a href='sub_drive.php' target='_blank'>Next</a></td></tr></table>";
}
?>
</div>
</DIV>
</DIV>
<script language="javascript">
function alternate(id){
if(document.getElementsByTagName){
var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");
for(i = 0; i < rows.length; i++){
//manipulate rows
if(i % 2 == 0){
rows[i].className = "even";
}else{
rows[i].className = "odd";
}
}
}
}
</script>
</body>
</html>