|
|
|
รบกวนดูโค้ดที่เกี่ยวกับการจัดรูปแบบ มันขึ้นบรรทัดใหม่เองไปไกลมาก TR TD TH |
|
|
|
|
|
|
|
รบกวนช่วยดูโค้ดตัวนนี้หน่อยนะครับ ผมมือใหม่ งง กับโค้ดมาก
ผมเอาตัวงานของเพื่อนมาโมดิฟายเป็นของผมเอง เลยทำให้มึนที่อยากทราบคือตรงหน้า index แทบซ้ายมือผม select ฐานข้อมูลแสดงประเภทสินค้ามาแล้วมันทำให้หน้าแรกตรงเนื้อหามันขึ้นบรรทัดใหม่ไปไกลเลย(คอลัมที่ 2) เลยไม่รู้จะแก้ยังไง มึนกับโค้ดจริง ๆ ครับ (โค้ดอาจจะดูไม่เรียบร้อยนะครับเพราะผมทำในดรีม มือใหม่จริงๆ)
Code (PHP)
<?php
session_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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bakery</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function MouseOverMenu(id){
document.getElementById(id).className='MouseOverMenu';
}
function MouseOutMenu(id){
document.getElementById(id).className='MouseOutMenu';
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
</script>
<script language = "javascript">
function check(){
if(document.frmname.txtusername.value==""){
alert("กรุณาป้อนชื่อค่ะ");
document.frmname.txtusername.focus();
return false;
}else if(document.frmname.txtpassword.value==""){
alert("กรุณาป้อนรหัสค่ะ");
document.frmname.txtpassword.focus();
return false;
}else{
return true;
}
}
function fncAction1(){
frmname.action='register.php'
frmname.target='if_main';
frmname.submit();
}
function fncAction2(){
fsearch.action='showsearch.php'
fsearch.target='if_main';
fsearch.submit();
}
</script>
<script language = "javascript"> //keyเฉพาะ a-z ก-ฮ
function not_number(e) {
if(window.event){ // IE
keynum = e.keyCode;
}
else if(e.which){ // Netscape/Firefox/Opera
keynum = e.which;
}
if ((keynum== 13 || keynum== 110) && (keynum > 48) || (keynum< 62)) {
event.returnValue = false;
}
}
</script>
<script language = "javascript">
function chkspace(){
if(event.keyCode == 32)
return false;
return true;
}
</script>
</head>
<body>
<table width="900" border="0" cellspacing="1" cellpadding="1" align="center">
<tr>
<td align="right">
<?php
include("admin/connect.php");
if (empty($_SESSION['id_member'])){
?> <a href="basket.php" target="if_main"><img src="photo/topbas.jpg" width="100" height="30" /></a>
<a href="register.php" target="if_main"><img src="photo/regis.jpg" width="100" height="30" /></a>
<a href="login.php" target="if_main"><img src="photo/login.jpg" width="100" height="30" /></a>
<?php } else {
$result=mysql_query("SELECT * FROM member WHERE id_member = '".$_SESSION['id_member']."' ");
$row=mysql_fetch_array($result);
if($row["status"] == "1")
session_destroy();
?>
ยินดีต้อนรับคุณ
<a href="user.php" target="if_main"><?php echo $row["i_name"];?></a> |
<a href="basket.php" target="if_main">ตะกร้าสินค้าของคุณ</a> |
<a href="logout.php">ออกจากระบบ</a>
</td>
<?php } ?>
<?php
mysql_close();
?>
</tr>
</table>
<table width="904" border="0" align="center" cellspacing="0">
<tr>
<td colspan="3" bgcolor="#FFFFFF"><img src="pic/logo.png" width="900" height="350" /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF"><a href="home.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','photo/menubar/b1-3.jpg',1)"><img src="photo/menubar/b1-1.jpg" name="Image9" width="150" height="50" border="0" id="Image9" /></a><a href="product.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','photo/menubar/b2-3.jpg',1)"><img src="photo/menubar/b2-1.jpg" name="Image10" width="150" height="50" border="0" id="Image10" /></a><a href="bank.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image11','','photo/menubar/b3-3.jpg',1)"><img src="photo/menubar/b3-1.jpg" name="Image11" width="150" height="50" border="0" id="Image11" /></a><a href="check_login_overdue.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image17','','photo/menubar/b5-3.jpg',1)"><img src="photo/menubar/b5-1.jpg" name="Image17" width="150" height="50" border="0" id="Image17" /></a><a href="about.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image12','','photo/menubar/b4-3.jpg',1)"><img src="photo/menubar/b4-1.jpg" name="Image12" width="150" height="50" border="0" id="Image12" /></a><a href="contact.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image80','','photo/menubar/b7-3.jpg',1)"><img src="photo/menubar/b7-1.jpg" name="Image80" width="150" height="50" border="0" id="Image80" /></a></td>
</tr>
<tr>
<td width="211" rowspan="4" bgcolor="#FFFFFF" valign="top">
<form method="post" name="frmname" action="check_login.php" onsubmit="return check()" target="if_main">
<table width="122" border="0" cellpadding="1" cellspacing="1" class="bordergray" valign="top">
<tr>
<?php
include("admin/connect.php");
if (empty($_SESSION['id_member'])){
?>
</tr>
<th colspan="2"><img src="photo/slogin.jpg" alt="" width="204" height="50" /></th>
<tr>
<td width="70" height="30">Username:</td>
<td width="131" height="30"><input name="txtusername" type="text" id="password" size="10" onKeyPress="return chkspace()"/></td>
</tr>
<tr>
<td height="30">Password:</td>
<td height="30"><input name="txtpassword" type="password" id="username" size="10" maxlength="10" onKeyPress="return chkspace()" /></td>
</tr>
<tr>
<td height="30"> </td>
<td height="30"><input type="submit" name="login2" id="login" value="login" />
<input type="button" name="register" id="register" onclick="fncAction1()" value="register" /></td>
</tr>
<tr>
<td height="30"> </td>
<td height="30"><a href="forgetpass.php" target="if_main">ลืมรหัสผ่าน</a></td>
</tr>
<tr>
<?php } else {
$result=mysql_query("SELECT * FROM member WHERE id_member = '".$_SESSION['id_member']."' ");
$row=mysql_fetch_array($result);
?>
<center>
<img src="gif/177453.jpg.gif" width="40" height="57" alt="" />
<h3><img src="photo/wel.jpg" width="200" height="50" /></h3>
<p>-- <?php echo $row["id_member"];?> -- </a></p>
<p><a href="user.php" target="if_main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image14','','photo/buttype/d1.jpg',1)"><img src="photo/buttype/d2.jpg" name="Image14" width="200" height="30" border="0" id="Image14" /></a> <a href="basket.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','photo/buttype/t1.jpg',1)"><img src="photo/buttype/t2.jpg" name="Image16" width="200" height="30" border="0" id="Image16" /></a> <a href="logout.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','photo/buttype/o1.jpg',1)"><img src="photo/buttype/o2.jpg" name="Image19" width="200" height="30" border="0" id="Image19" /></a><br />
</p>
</center>
<?php
}
mysql_close();
?>
</tr>
</table>
</form>
<table width="200" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><img src="photo/list.JPG" alt="" width="200" height="50" /></td>
</tr>
<tr>
<td><a href="stove.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image15','','photo/buttype/cat_1-2.jpg',1)"><img src="photo/buttype/cat_1-1.jpg" alt="" name="Image15" width="200" height="50" border="0" id="Image15" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="1"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
<td><a href="machine.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','photo/buttype/cat_2-2.jpg',1)"><img src="photo/buttype/cat_2-1.jpg" alt="" name="Image16" width="200" height="50" border="0" id="Image" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="2"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
<td><a href="pas_tools.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','photo/buttype/cat_3-2.jpg',1)"><img src="photo/buttype/cat_3-1.jpg" alt="" name="Image19" width="200" height="50" border="0" id="Image2" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="3"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
<td><a href="bakewares.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','photo/buttype/cat_4-2.jpg',1)"><img src="photo/buttype/cat_4-1.jpg" alt="" name="Image21" width="200" height="50" border="0" id="Image21" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="4"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
<td><a href="choc_tools.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image20','','photo/buttype/cat_5-2.jpg',1)"><img src="photo/buttype/cat_5-1.jpg" alt="" name="Image20" width="200" height="50" border="0" id="Image20" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="5"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
<td><a href="packaging.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','photo/buttype/cat_6-2.jpg',1)"><img src="photo/buttype/cat_6-1.jpg" alt="" name="Image22" width="200" height="50" border="0" id="Image22" /></a></td>
</tr>
<tr>
<td>
<?php include "admin/connect.php" ?>
<?php
$strSql="SELECT * FROM type";
$result=mysql_query($strSql);
if ($result){
while($tbarr=mysql_fetch_array($result))
{
if ($tbarr["category_id"]=="6"){
?>
<a href="product.php?type_id=<?php echo $tbarr['type_id'];?>"><?php echo "- ".$tbarr['type_name']; ?></a><p>
<?php
}
}}
mysql_close();
?>
</td>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
<table width="206" border="0" cellspacing="1" cellpadding="1" valign="top">
<tr>
<td width="100"><a href="https://www.facebook.com/attapornbakery" target="_blank" onmouseover="MM_swapImage('Image13','','photo/fb2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="photo/fb1.jpg" alt="" name="Image13" width="100" height="100" border="0" id="Image13" /></a></td>
<td width="99"><a href="https://twitter.com/attapornbakery" target="_blank" onmouseover="MM_swapImage('Image14','','photo/twitter2.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="photo/twitter1.jpg" alt="" name="Image14" width="100" height="100" border="0" id="Image14" /></a></td>
</tr>
</table>
<p> </p></td>
<td width="689" colspan="2" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF" valign="top">
<marquee>ยินดีต้อนรับสู่เว็บไซต์อรรถพร อุปกรณ์เบเกอรี่ ร้านเรามีอุปกรณ์และวัตถุดิบเบเกอรี่มากมายให้เลือกซื้อเลือกชมกัน</marquee>
<form name="fsearch" method="post" action="index.php">
<table width="300" border="0" align="right" cellpadding="1" cellspacing="1" >
<tr>
<td width="131" align="right">
กรอกชื่อที่จะค้นหา <input name="keyin" type="text" id="textfield" size="10" onkeypress="not_number(event)" />
<input type="submit" value="GO" onclick="fncAction2()" >
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan="1" bgcolor="#FFFFFF"><img src="photo/welcome_h.jpg" width="680" height="40" /></td>
</tr>
<tr>
<td height="540" colspan="2" bgcolor="#FFFFFF"><iframe name="if_main" src="home.php" height="1000" width="680"></iframe></td>
</tr>
<tr bgcolor="#FAC956">
</tr>
<tr bgcolor="#FAC956">
</tr>
<tr bgcolor="#FAC956">
</tr>
<tr bgcolor="#FAC956">
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="3" bgcolor="#FFFFFF"><img src="photo/end.jpg" width="900" height="100" /></td>
</tr>
</table>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="20" colspan="3" bgcolor="#FFFFFF"> </td>
</tr>
</table>
<script type="text/javascript">
swfobject.registerObject("");
</script>
</body>
</html>
Tag : PHP, HTML/CSS
|
|
|
|
|
|
Date :
2016-07-24 00:55:47 |
By :
มงคล |
View :
977 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช้ css จัดหน้าเว็บพ่อคุ๊ณณณณณ
table เค้าไม่ใช้กันละ
|
|
|
|
|
Date :
2016-07-24 10:39:12 |
By :
compiak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตามคุณ compiak เลยครับ
ถ้าใช้ Table Design อาจจะเพี้ยง เนื่องด้วย จำนวน font ขนาด หรือ Browser แต่ละตัว แสดงผลต่างกัน
|
|
|
|
|
Date :
2016-07-25 10:13:33 |
By :
dudesaranyu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|