碰到php变量 赋值怪事.
遇到php变量 赋值怪事............
今天修改程序的时候遇到的怪事.
我先直接赋值
$swfpath="F:/ComsenzEXP/wwwroot/docs/2012/09/10/";
$pdfpath="F:/ComsenzEXP/wwwroot/filestores/2012/09/10/";
这样程序能运行
但是我把上面的变量改成这样后,程序就不能运行了
$swfpath=$_SERVER[DOCUMENT_ROOT]."/docs/".$file['file_store_path'];
$pdfpath=$_SERVER[DOCUMENT_ROOT]."/".$settings['file_path']."/".$file['file_store_path'];
echo出来的值完全一样,请问这是什么原因造成的....
因为不能显示错误,所以前来求助
还是这个程序,$page=$_GET['page'];程序正常,但是直接赋值就不行了如$page="[*,0],8";尽管他们echo出来的值一模一样,真是见鬼了.......
这个程序就是FlexPaper php的演示程序,我想把他嵌入到我的程序中,中间遇到这么些郁闷问题
------解决方案--------------------
1. $_SERVER[DOCUMENT_ROOT],由于没有给键值加引号来告诉PHP这是一个字符串,将会产生一个notice级别的错误,可能会引发之后的header()函数出错,进而产生warning级别的错误。如果不能显示错误,PHP将自行终止
2. $page=$_GET['page'];程序正常,但是直接赋值就不行了如$page="[*,0],8";
不知道你说的不行是什么情况?
------解决方案--------------------
var_dump("F:/ComsenzEXP/wwwroot/docs/2012/09/10/" == $_SERVER[DOCUMENT_ROOT]."/docs/".$file['file_store_path']);
------解决方案--------------------
在程序头加上着两行,再看看提示是什么错误。
- PHP code
ini_set('display_errors', 'On'); error_reporting(E_ALL); <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

Use Java's File.length() function to get the size of a file. File size is a very common requirement when dealing with file operations. Java provides a very convenient way to get the size of a file, that is, using the length() method of the File class. . This article will introduce how to use this method to get the size of a file and give corresponding code examples. First, we need to create a File object to represent the file we want to get the size of. Here is how to create a File object: Filef

How to convert php blob to file: 1. Create a php sample file; 2. Through "function blobToFile(blob) {return new File([blob], 'screenshot.png', { type: 'image/jpeg' })} ” method can be used to convert Blob to File.

Use Java's File.renameTo() function to rename files. In Java programming, we often need to rename files. Java provides the File class to handle file operations, and its renameTo() function can easily rename files. This article will introduce how to use Java's File.renameTo() function to rename files and provide corresponding code examples. The File.renameTo() function is a method of the File class.

WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows

Use java's File.getParentFile() function to get the parent directory of a file. In Java programming, we often need to operate files and folders. When we need to get the parent directory of a file, we can use the File.getParentFile() function provided by Java. This article explains how to use this function and provides code examples. File class in Java is the main class used to operate files and folders. It provides many methods to obtain and manipulate file properties

On September 3, version 1.5 of the Grand Theft Auto VI document which provides a detailed overview of everything that is known about the game to date. The updated version of the document was announced in a trailer published on X (formerly Twitter).??

On the occasion of releasing the build 26040 version of Windows Server, Microsoft announced the official name of the product: Windows Server 2025. Also launched is the Windows11WindowsInsiderCanaryChannel version build26040. Some friends may still remember that many years ago someone successfully converted Windows NT from workstation mode to server mode, showing the commonalities between various versions of Microsoft operating systems. Although there are clear differences between Microsoft's current version of the server operating system and Windows 11, those who pay attention to the details may be curious: why Windows Server updated the brand,
