<!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>
<style type="text/css">
*{
margin: 0;
padding: 0;
border:0;
font-size: 18px;
font-family:"Arial Unicode MS", "Arial";
}
body{
background-color:#000000;
}
#main{
width:765px;
margin:auto;
}
#top{
width:765px;
margin:auto;
float:left;
}
.logo{
width:765px;
height:150px;
margin:auto;
float:left;
}
.img_logo{
width:765px;
height:150px;
margin:auto;
}
#director{
width:765px;
margin:auto;
float:left;
}
.menu_top{
margin:auto;
float:left;
background-image:url(img/nav_bg.jpg);
}
.menu_a{
font-size:22px;
font-weight:bolder;
color:#FFFFFF;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<div id="main">
<div id="top">
<!--注册登录-->
<!--注册登录-->
<!--logo-->
<div class="advertising_top"> <img src="img/top.jpg" class="img_logo" /></div>
<!--logo结束-->
<!--导航开始-->
<div id="director">
<script language="php">
<?php
$link=mysql_connect('localhost','root','5225')or die('Could not connect:'.mysql_error());
mysql_select_db('matv')or die ('Could not select database');
$level="SELECT CategoryName FROM ma_category where CategoryLevel=1 ";
mysql_query('set Names "UTF8"'); /*db编码转为utf-8,要先转再查询,不然会乱码*/
$result=mysql_query($level); /*执行sql语句*/
$row=mysql_fetch_array($result);
$thename=$row['theName'];while($line = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<div class='menu_top'><a target='_self' class='menu_a' href=''>{$line['CategoryName']}</a></div>";
}
mysql_free_result($result);
mysql_close($link);
?>
</script>
</div>
<!--导航结束-->
</div></div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
*{
margin: 0;
padding: 0;
border:0;
font-size: 18px;
font-family:"Arial Unicode MS", "Arial";
}
body{
background-color:#000000;
}
#main{
width:765px;
margin:auto;
}
#top{
width:765px;
margin:auto;
float:left;
}
.logo{
width:765px;
height:150px;
margin:auto;
float:left;
}
.img_logo{
width:765px;
height:150px;
margin:auto;
}
#director{
width:765px;
margin:auto;
float:left;
}
.menu_top{
margin:auto;
float:left;
background-image:url(img/nav_bg.jpg);
}
.menu_a{
font-size:22px;
font-weight:bolder;
color:#FFFFFF;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<div id="main">
<div id="top">
<!--注册登录-->
<!--注册登录-->
<!--logo-->
<div class="advertising_top"> <img src="img/top.jpg" class="img_logo" /></div>
<!--logo结束-->
<!--导航开始-->
<div id="director">
<script language="php">
<?php
$link=mysql_connect('localhost','root','5225')or die('Could not connect:'.mysql_error());
mysql_select_db('matv')or die ('Could not select database');
$level="SELECT CategoryName FROM ma_category where CategoryLevel=1 ";
mysql_query('set Names "UTF8"'); /*db编码转为utf-8,要先转再查询,不然会乱码*/
$result=mysql_query($level); /*执行sql语句*/
$row=mysql_fetch_array($result);
$thename=$row['theName'];while($line = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<div class='menu_top'><a target='_self' class='menu_a' href=''>{$line['CategoryName']}</a></div>";
}
mysql_free_result($result);
mysql_close($link);
?>
</script>
</div>
<!--导航结束-->
</div></div>
</body>
</html>
解决方案 »
- 用MYSQL做运算和用PHP做运算,哪个优
- 关于上传图片 及显示文件名 然后下载的问题
- 請教一句mysql 語句。
- 正则表达式匹配url地址的问题求救
- 自从学.net就发觉自己整天在学新技术,新名词了,很少有时间把精力集中到具体业务编程上。
- (100分)session 跨站无法传递问题!急急急
- 用PHP如何控制登陆人数,在规定时间将超时用户踢出去!?谢谢各位大侠!
- 用php编聊天室的基本原理?
- thinkPHP中怎么可不可以将当前的控制器名称写入一个配置项里面?
- phpexcel 在laravel5.1下save('php://output') 报500错误
- php 导入导出怎么做成有进度条??
- 关于页面编码问题 求详解
查看网页源代码如下:<!--导航开始-->
<div id="director">
<script language="php">
<?php
$link=mysql_connect('localhost','root','5225')or die('Could not connect:'.mysql_error());
mysql_select_db('matv')or die ('Could not select database');
$level="SELECT CategoryName FROM ma_category where CategoryLevel=1 ";
mysql_query('set Names "UTF8"'); /*db编码转为utf-8,要先转再查询,不然会乱码*/
$result=mysql_query($level); /*执行sql语句*/
$row=mysql_fetch_array($result);
$thename=$row['theName'];
while($line = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<div class='menu_top'><a target='_self' class='menu_a' href=''>{$line['CategoryName']}</a></div>";
}
mysql_free_result($result);
mysql_close($link);
?>
</script>
</div>
<!--导航结束--> 运行里面 localhost...那么启动的 他没有读php那段代码我感觉
我改了.php文件 但是html部分没了啊 !~
AddType application/x-httpd-php .php .html .htm