|
|
|
php mysql มีใครสอนให้ทำแบงหน้าเว็บหน่อยได้ไหมครับ..... |
|
|
|
|
|
|
|
สอนให้ทำแบงหน้าเว็บหน่อยครับ
ขอบคุณครับ
Code (PHP)
<?
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<?
//Connect Database
include 'config.inc';
echo $hostname;
$link = mysql_connect("$hostname", "$username", "$password");
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully<br>';
//Select Database
mysql_select_db(navapanc_reru) or die("cannot connect DB");
//SQL Command
$sql ="SELECT * FROM sign";
//Running SQL Command
$dbquery = mysql_db_query(navapanc_reru, $sql);
//Count numrows
$num_rows = mysql_num_rows($dbquery);
//show result
?>
<body onload="MM_preloadImages('images/Menu-02.png','images/Menu-03.png','images/Menu-05.png','images/Menu-06.png')">
<form id="form1" name="form1" method="post" action="">
<table width="1104" border="0" align="center">
<tr>
<td width="1093"><img src="images/Menu-by-finance_01.png" width="566" height="48" /><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','images/Menu-02.png',1)"><img src="images/Menu-by-finance_02.png" name="Image8" width="137" height="48" border="0" id="Image8" /></a><a href="update.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/Menu-03.png',1)"><img src="images/Menu-by-finance_03.png" name="Image4" width="137" height="48" border="0" id="Image4" /></a><a href="LocateDataTime.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/Menu-05.png',1)"><img src="images/Menu-by-finance_05.png" name="Image6" width="132" height="48" border="0" id="Image6" /></a><a href="contact.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','images/Menu-06.png',1)"><img src="images/Menu-by-finance_06.png" name="Image7" width="149" height="48" border="0" id="Image7" /></a></td>
<td width="10"> </td>
</tr>
<tr>
<td><table width="1131" height="29" border="0" cellpadding="3" cellspacing="2">
<tr class="heading">
<td width="5%" align="left" bgcolor="#D2E4FF">ระดับ</td>
<td width="5%" align="left" bgcolor="#D2E4FF">วันที</td>
<td width="7%" align="left" bgcolor="#D2E4FF">ชื่อ-นามสกุล</td>
<td width="7%" align="left" bgcolor="#D2E4FF">เบอร์โทร</td>
<td width="7%" align="left" bgcolor="#D2E4FF">ที่อยู่</td>
<td width="13%" align="left" bgcolor="#D2E4FF">จังหวัด</td>
<td width="12%" align="left" bgcolor="#D2E4FF">ประเภทรถยนต์</td>
<td width="5%" align="left" bgcolor="#D2E4FF">ยี่ห้อ</td>
<td width="12%" align="left" bgcolor="#D2E4FF">ปีจดทะเบียน</td>
<td width="9%" align="left" bgcolor="#D2E4FF">อีเมล์ </td>
<td width="13%" align="left" bgcolor="#D2E4FF">ยอดจัด</td>
<td width="10%" align="left" bgcolor="#D2E4FF">วันที่ส่ง</td>
<td width="10%" align="left" bgcolor="#D2E4FF">สาขาหลัก</td>
<td width="10%" align="left" bgcolor="#D2E4FF">ส่งต่อให้</td>
<td width="10%" align="left" bgcolor="#D2E4FF">สถานะ</td>
<td width="10%" align="left" bgcolor="#D2E4FF">update</td>
</tr>
<?
$bgcolor = "#FFFFD2";
$i=0;
$tt = 0;
while($i < $num_rows)
{
$tt = $tt+1 ;
$result = mysql_fetch_array($dbquery);
$sign_id = $result[sign_id];
$width = $result[width];
$date = $result[date];
$long = $result[long];
$name = $result[name];
$tell = $result[tell];
$add = $result[add];
$address = $result[address];
$detail = $result[detail];
$car = $result[car];
$year = $result[year];
$sex = $result[sex];
$ssk = $result[ssk];
$branch = $result[branch];
$status = $result[status];
if($bgcolor == "#FFFFD2")
{
$bgcolor = "#E6FFEC";
} else
{
$bgcolor = "#FFFFD2";
}
echo "<tr class=\"data\">";
echo "<td width=\"5%\" bgcolor=\"$bgcolor\">$tt</td>";
echo "<td width=\"15%\" bgcolor=\"$bgcolor\">$date</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$name</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$tell</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$add</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$address</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$sex</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$car</td>";
echo "<td width=\"5%\" bgcolor=\"$bgcolor\">$year</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$detail</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$width</td>";
echo "<td width=\"25%\" bgcolor=\"$bgcolor\">$long</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\">$ssk</td>";
echo "<td width=\"25%\" bgcolor=\"$bgcolor\">$branch</td>";
echo "<td width=\"25%\" bgcolor=\"$bgcolor\">$status</td>";
echo "<td width=\"10%\" bgcolor=\"$bgcolor\"><a href=\"updateform.php?sign_id=$sign_id&&width=$width&&long=$long&&name=$name&&tell=$tell&&detail=$detail&&add=$add&&address=$address&&car=$car&&year=$year&&sex=$sex&&ssk=$ssk \">update</a></td>";
echo "</tr>";
$i++;
}
//Disconnect Database
mysql_close($link);
?>
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
Tag : PHP, HTML/CSS
|
|
|
|
|
|
Date :
2012-06-22 15:45:00 |
By :
huythun |
View :
861 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|