Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 页面最顶部使用include后,会显示空白行,css也不正常,求解决方法

页面最顶部使用include后,会显示空白行,css也不正常,求解决方法

Jun 23, 2016 pm 01:55 PM
css show Solution

页面是utf-8编码
编辑器:dreamweaver 页面属性已经勾选了  包括Unicode签名(BOM)(s)
这样页面顶部会显示一行空白,查看源代码什么都正常:

<?php include_once("inc.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>
Copy after login


回复讨论(解决方案)

确定不是代码产生的对吧? 如果确定不是代码产生的话,换个编辑器用utf-8无bom头编码保存一下。

文件编码如果是utf-8,头部会占用3个字符,文件改成无bom看看。

“dreamweaver 页面属性已经勾选了 包括Unicode签名(BOM)(s)”

在DW中,按CTRL+J,编码,然后不要勾选此项,PHP本身是无法识别BOM头信息的,所以会出现COOKIE、SESSION、空白异常等状况

感谢,取消  包括Unicode签名(BOM)(s) 这个确实变正常了!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

How to interpret warnings in Tomcat logs How to interpret warnings in Tomcat logs Apr 12, 2025 pm 11:45 PM

Warning messages in the Tomcat server logs indicate potential problems that may affect application performance or stability. To effectively interpret these warning information, you need to pay attention to the following key points: Warning content: Carefully study the warning information to clarify the type, cause and possible solutions. Warning information usually provides a detailed description. Log level: Tomcat logs contain different levels of information, such as INFO, WARN, ERROR, etc. "WARN" level warnings are non-fatal issues, but they need attention. Timestamp: Record the time when the warning occurs so as to trace the time point when the problem occurs and analyze its relationship with a specific event or operation. Context information: view the log content before and after warning information, obtain

Can visual studio code be used in python Can visual studio code be used in python Apr 15, 2025 pm 08:18 PM

VS Code can be used to write Python and provides many features that make it an ideal tool for developing Python applications. It allows users to: install Python extensions to get functions such as code completion, syntax highlighting, and debugging. Use the debugger to track code step by step, find and fix errors. Integrate Git for version control. Use code formatting tools to maintain code consistency. Use the Linting tool to spot potential problems ahead of time.

What are the common misunderstandings in CentOS HDFS configuration? What are the common misunderstandings in CentOS HDFS configuration? Apr 14, 2025 pm 07:12 PM

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo

Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

Docker restarts using GPU server Docker restarts using GPU server Apr 15, 2025 am 06:48 AM

Server restart when using Docker on a GPU server is caused by the following reasons: CUDA version conflict driver issue Memory allocation error Solution: Make sure the CUDA version matches the update driver limit GPU memory allocation

Nginx Server Installation and Quick Configuration Guide Nginx Server Installation and Quick Configuration Guide Apr 13, 2025 pm 10:18 PM

This article introduces the construction and configuration methods of Nginx. 1. Install Nginx: Use sudoyumininstallnginx on CentOS, use sudoapt-getinstallnginx on Ubuntu, and start with sudosystemctlstartnginx after installation. 2. Basic configuration: Modify the /etc/nginx/nginx.conf file, mainly modify the listen (port) and root (site root directory) instructions in the server block, and after modification, use sudosystemctlrestartnginx to restart and take effect. 3. Virtual host configuration: in nginx.co

The relationship between nginx and web server The relationship between nginx and web server Apr 14, 2025 am 07:09 AM

nginx is a lightweight, non-blocking web server and reverse proxy, commonly used for front-end proxy, load balancing, and caching. Its relationship with a web server is usually: Front-end proxy: nginx handles requests and forwards them to the back-end server. Load Balancer: nginx distributes requests to multiple backend servers. Caching: nginx caches frequently accessed files for performance.

See all articles