中国设计秀欢迎投稿
中国品牌形像设计网
平面设计 画册 VI欣赏 包装 CG-插画 搜索 个人网页 Alexa排名 CSS 建站资源 下载专区 JS特效 品牌服装 服装院校 专题欣赏 SEO 图标欣赏 专题
深圳网站建设 广州网站设计 域名注册 上海网站建设 虚拟主机 广州网站建设 广州网页设计 签名设计 虚拟主机 域名注册 品牌形象设计 设计联盟
求创科技
上海网麒科技
中国福网
中国设计秀
亿恩科技
中国设计秀
中国设计秀
当前位置:网络学院首页 >> 编程开发 >> php >> php开发大型程序应该注意的问题

php开发大型程序应该注意的问题 (3)

来源:中国设计秀    作者:    点击:247     加入收藏    发表评论
0
顶一下
中资源

  <?php

   $dbh = mysql_connect ("localhost", "sh", "pass") or die (sprintf ("Cannot connect to MySQL [%s]: %s",
  mysql_errno (), mysql_error ()));
  @mysql_select_db ("MainSite")
  or die (sprintf ("Cannot select database [%s]: %s",
  mysql_errno (), mysql_error ()));

   $sth = @mysql_query ("SELECT * FROM site",  $dbh)
  or die (sprintf ("Cannot execute query [%s]: %s",
  mysql_errno (), mysql_error ()));

   $site_info = mysql_fetch_object ( $sth);

  function print_header ()
  {
   global  $site_info;
   print  $site_info->header; 字串4
  }

  function print_body ()
  {
   global  $site_info;
   print nl2br ( $site_info->body);
  }

  function print_links ()
  {
   global  $site_info;

    $links = explode ("\n",  $site_info->links);
    $names = explode ("\n",  $site_info->link_names);

  for ( $i = 0;  $i < count ( $links);  $i++)
  {
   print "\t\t\t
   <a href=\" $links[ $i]\"> $names[ $i]</a>
   \n<br>\n";
  }
  }
  ?>

[1] [2] [3] [4]
2007-09-13 16:23:00    出处:
热点文章/相关文章
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明 | 网站公告 | 友情链接 | 留言 | 旧版入口