|
|
|
Connect Database ไม่ได้ครับ... PHP รันแล้วไม่ึขึ้นอะไรเลยเป็นหน้า Page ว่างๆ |
|
|
|
|
|
|
|
คือว่าผมทดลอง Code มาหลายวันแล้วครับ Code (PHP) ผมลองรันดูที่หน้าเว็บ มันไม่ขึ้นข้อความไรเลยสักอย่างไม่ทราบว่าเป็นที่อะไรหรอครับ
=============================================================================================
Code <connect>
Name :: conn.php
<?
$connect = mysql_connect("localhost","root","6132");
if(!$connect)
{
echo "Database Connect Failed.";
}
?>
=============================================================================================
Code <Webrowser>
Name :: register.php
<?
include('conn.php');
?>
<!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=windows-874" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:1062px;
top:197px;
width:191px;
height:1453px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:236px;
top:211px;
width:790px;
height:25px;
z-index:2;
}
.style1 {color: #0000CC}
#apDiv3 {
position:absolute;
left:1074px;
top:314px;
width:171px;
height:75px;
z-index:3;
}
#apDiv4 {
position:absolute;
left:1079px;
top:268px;
width:168px;
height:54px;
z-index:4;
}
.style2 {
color: #330000;
font-weight: bold;
}
.style3 {
font-size: x-large;
color: #CCCCCC;
}
#apDiv5 {
position:absolute;
left:1119px;
top:382px;
width:172px;
height:67px;
z-index:5;
}
#apDiv6 { position:absolute;
left:1080px;
top:213px;
width:168px;
height:54px;
z-index:4;
}
#apDiv7 {
position:absolute;
left:1079px;
top:414px;
width:171px;
height:59px;
z-index:6;
}
#apDiv8 {
position:absolute;
left:207px;
top:249px;
width:827px;
height:57px;
z-index:7;
}
#apDiv9 {
position:absolute;
left:220px;
top:359px;
width:820px;
height:1320px;
z-index:8;
}
#apDiv10 {
position:absolute;
left:256px;
top:369px;
width:211px;
height:143px;
z-index:9;
}
.style6 {
font-size: x-large;
font-weight: bold;
font-style: italic;
color: #00FFFF;
}
#apDiv11 {
position:absolute;
left:458px;
top:261px;
width:80px;
height:38px;
z-index:9;
}
.style7 {color: #FFFF00}
.style8 {color: #00FF00}
.style9 {color: #FF00FF}
.style10 {
color: #FFFFFF
}
a:active {
color: #FFFFFF;
text-decoration: none;
}
a:link {
text-decoration: none;
color: #FFFFFF;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
#apDiv12 {
position:absolute;
left:1052px;
top:254px;
width:203px;
height:211px;
z-index:9;
}
#apDiv13 {
position:absolute;
left:1055px;
top:475px;
width:200px;
height:175px;
z-index:10;
}
#apDiv14 {
position:absolute;
left:1101px;
top:661px;
width:108px;
height:103px;
z-index:11;
}
#apDiv15 {
position:absolute;
left:1054px;
top:787px;
width:204px;
height:319px;
z-index:12;
}
#apDiv16 {
position:absolute;
left:1067px;
top:774px;
width:175px;
height:307px;
z-index:12;
}
#apDiv17 {
position:absolute;
left:15px;
top:255px;
width:199px;
height:179px;
z-index:13;
}
#apDiv18 {
position:absolute;
left:15px;
top:775px;
width:186px;
height:488px;
z-index:14;
}
#apDiv19 {
position:absolute;
left:9px;
top:463px;
width:203px;
height:278px;
z-index:15;
}
#apDiv20 {
position:absolute;
left:220px;
top:320px;
width:146px;
height:39px;
z-index:16;
}
#apDiv21 {
position:absolute;
left:542px;
top:330px;
width:117px;
height:49px;
z-index:16;
}
#apDiv22 {
position:absolute;
left:542px;
top:341px;
width:170px;
height:59px;
z-index:16;
}
#apDiv23 {
position:absolute;
left:578px;
top:357px;
width:138px;
height:30px;
z-index:17;
}
.style11 {
color: #FFFFFF;
font-size: large;
font-weight: bold;
}
#apDiv24 {
position:absolute;
left:54px;
top:506px;
width:111px;
height:37px;
z-index:18;
}
#apDiv25 {
position:absolute;
left:54px;
top:550px;
width:110px;
height:34px;
z-index:19;
}
#apDiv26 {
position:absolute;
left:55px;
top:593px;
width:108px;
height:33px;
z-index:20;
}
#apDiv27 {
position:absolute;
left:382px;
top:486px;
width:497px;
height:330px;
z-index:21;
}
#apDiv28 {
position:absolute;
left:543px;
top:854px;
width:71px;
height:64px;
z-index:22;
}
#apDiv29 {
position:absolute;
left:619px;
top:854px;
width:72px;
height:65px;
z-index:23;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body bgcolor="#CB9D7B">
<form name="add" method="post" action="addreg.php">
<div id="apDiv1">
<table width="191" height="1450" border="0" align="right">
<tr>
<th width="191" scope="row"> </th>
</tr>
</table>
</div>
<div id="apDiv2">
<marquee align="right">
<font size="3"><span class="style1 style10">""" ยินดีต้อนรับเข้าสู่...เว็บไซต์สกรีนเสื้อออนไลน์ """</span></font>
</marquee>
</div>
<div id="apDiv8">
<table width="830" height="57" border="5" bordercolor="#CB9D7B">
<tr bordercolor="#FFFFFF">
<th width="157" bgcolor="#000000" scope="row"><span class="style6"><a href="menu.php"><img src="picture/icon/Image.bmp"></a></span></th>
<td width="157" bgcolor="#000000"><div align="center" class="style7"><a href="register.php"><img src="picture/icon/Image1.bmp"></a></div></td>
<td width="157" bgcolor="#000000"><div align="center" class="style8"><a href="older.php"><img src="picture/icon/Image2.bmp"></a></div></td>
<td width="157" bgcolor="#000000"><div align="center" class="style9"><a href="faq.php"><img src="picture/icon/Image3.bmp"></a></div></td>
<td width="160" bgcolor="#000000"><div align="center" class="style10"><a href="board.php"><img src="picture/icon/Image4.bmp"></a></div></td>
</tr>
</table>
</div>
<div id="apDiv9"><img src="picture/icon/BBG.JPG" width="819" height="1319" /></div>
<div id="apDiv13">
<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" name="flashplayer" src="http://i251.photobucket.com/albums/gg294/wafpaf/calendars/swf/flowers1.swf" quality="high" width="199" height="175" swliveconnect="true" allowscriptaccess="samedomain" />
</div>
<div id="apDiv14">
<embed src="http://i130.photobucket.com/albums/p256/Nbee01/clock/NBee6.swf" width="108" height="108" wmode="transparent" quality="high" loop="True" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
</div>
<div id="apDiv16">
<iframe marginWidth=0 marginHeight=0 src="http://www.pttplc.com/th/oilprice.asp" frameBorder=0 width=173 scrolling=no height=305></iframe>
</div>
<div id="apDiv17">
<table width="195" height="169" border="5" bordercolor="#FFFFFF">
<tr>
<td width="171" bordercolor="#FFFFFF" bgcolor="#000000" scope="row"><p align="center"><span class="style10">จำนวนผู้เข้าชมเว็บไซต์</span></p>
<p><a href="http://www.amazingcounters.com"><center><img src="http://cb.amazingcounters.com/counter.php?i=2939836&c=8819821" alt="paste html code" width="82" height="24" border="0">
</center></a></p></td>
</tr>
</table>
<p> </p>
</div>
<div id="apDiv18">
<center>
<p><img src="picture/icon/Banner01.gif" /></p>
<p><img src="picture/icon/Banner02.gif" /></p>
<p><img src="picture/icon/Banner01.gif" /></p>
<p><img src="picture/icon/Banner02.gif" /></p>
</center>
</div>
<div id="apDiv19"><img src="picture/icon/10xx0.gif" width="196" height="273"></div>
<div id="apDiv22"><img src="picture/icon/BBG.JPG" width="171" height="58"></div>
<div class="style11" id="apDiv23">สมัครสมาชิก</div>
<div id="apDiv24"><img src="picture/icon/bn.gif"></div>
<div id="apDiv25"><img src="picture/icon/bn01.gif"></div>
<div id="apDiv26"><img src="picture/icon/roomchat.gif"></div>
<div id="apDiv27">
<table width="495" height="329" border="0">
<tr>
<th width="135" scope="row"><div align="right">ชื่อที่ใช้เข้าระบบ</div></th>
<td width="30"><div align="center">::</div></td>
<td width="308">
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">รหัสผ่าน</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<input type="password" name="textfield4" id="textfield4" />
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">ชื่อ</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<input type="text" name="textfield5" id="textfield5" />
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">นามสกุล</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<input type="text" name="textfield6" id="textfield6" />
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">E-mail</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<input type="text" name="textfield7" id="textfield7" />
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">ที่อยู่</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
</label>
</td>
</tr>
<tr>
<th scope="row"><div align="right">เบอร์โทรศัพท์</div></th>
<td><div align="center">::</div></td>
<td>
<label>
<input type="text" name="textfield8" id="textfield8" />
</label>
</td>
</tr>
</table>
</div>
<div id="apDiv28">
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</div>
<div id="apDiv29">
<label>
<input type="reset" name="button2" id="button2" value="Reset" />
</label>
</div>
<center>
<table width="969" height="188" border="0">
<tr>
<th width="959" height="182" scope="row"><img src="picture/background/HBGS.gif" /></th>
</tr>
</table>
</center>
<table width="191" height="1450" border="0">
<tr>
<th scope="row"> </th>
</tr>
</table>
</form>
</body>
</html>
=============================================================================================
Code <Add_DB>
Name :: addreg.php
<?
include ('conn.php');
$db = mysql_select_db("db_shop");
$strSQL = "INSERT INTO tb_regis ";
$strSQL .="(id,pass,fname,lname,email,add,tel) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["textfield3"]."','".$_POST["textfield4"]."','".$_POST["textfield5"]."' ";
$strSQL .=",'".$_POST["textfield6"]."','".$_POST["textfield7"]."','".$_POST["textarea"]."') ";
$strSQL .=",'".$_POST["textfield8"]."') ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<a href="home.php">กลับไปหน้าหลัก</a>
=============================================================================================
ปล. Adobe Dream CS3, Appserv 2.5.10
Tag : PHP, MySQL, CakePHP
|
|
|
|
|
|
Date :
2011-02-02 20:24:26 |
By :
fn00kf |
View :
988 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|