473,763 Members | 9,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Including files that have query strings

I am having trouble with accessing files with query strings. For
example the code "require 'template.php?1 02932'" gives the following
error:
Warning: main(/www/blog/template.php?10 2932): failed to open stream:
Invalid argument in C:\www\blog\200 4\12\27\best-of-2004\index.php on
line 54

Fatal error: main(): Failed opening required
'/www/blog/template.php?10 2932' (include_path=' .;c:\php4\pear' ) in
C:\www\blog\200 4\12\27\best-of-2004\index.php on line 54

I have no idea what's going on. Is it impossible to open files with
query strings in PHP? I am running PHP 4.3.9 on Apache 2/Win.

Jul 17 '05 #1
1 1498
*** th******@gmail. com escribió/wrote (21 Jan 2005 23:25:19 -0800):
Warning: main(/www/blog/template.php?10 2932): failed to open stream:
Invalid argument in C:\www\blog\200 4\12\27\best-of-2004\index.php on
line 54

I have no idea what's going on. Is it impossible to open files with
query strings in PHP? I am running PHP 4.3.9 on Apache 2/Win.


Files do not have query strings. URLs do have query strings.

If you want to create a variable to use in the included file, why don't you
just, well, do it? Including a file is exactly the same as copying its
contents in current file.

<?
$foo=102932;
require('templa te.php');
?>

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2064
by: Logical | last post by:
I wanted to do: include('page.htm?id=12&foo=bar'); But since I can't (and don't want to make another seperate HTTP request with include('http://...')); I was wondering if there's a function similar to extract(); that can handle a query string as input, so that I could: $id = 12; $foo = 'bar'; include('page.htm');
3
3747
by: Matthew Moran | last post by:
I am creating a series of downloadable articles, career tools, spreadsheets, etc. However, some of the content is for "registered" guest. The registrants are stored in a database and logon. I want to ensure that someone registered cannot simply pass someone the path to the files for download. However, I am not creating an actual system user name for the folders where the various documents exist.
5
13275
by: Raj | last post by:
Hi all, Can anyone help me with a script which would delete files or move them to a different folder at some scheduled time..! Please.....!!! Thanks in advance...
3
1797
by: Sean Quinn | last post by:
Hi, I don't know if anyone has run into similar problems, but it seems like when I use `require_once(...)' with files that contain functions I get an error indicating that it can't redeclare the functions. I thought the point of the once directive was to PREVENT the system from including duplicate files (and thus attempting to redeclare the functions). It has worked elsewhere, for instance I have a database.php file, that
12
1319
by: Bahman | last post by:
Hello! I have one issue that I am trying to work out. I am creating an RSS XML feed. However, I want the user at the other end to be able to query the XML file, for example, display only records for a particular room. This would be similar to 'where room_id = 12'. Is there an easy way to do this?
8
5125
by: dagecko | last post by:
Hi I would like to know how to detect if a file is binary or not. It's important for me but I don't know where to start. Ty
4
1858
by: TCook | last post by:
Hey All, I am building a solution which will have many strings that will need to be localized (i.e. strings for toolbars, strings for different WinForms, strings for messages and error messages, etc.). I am having trouble accessing string file resources. What I want to do is to break out strings into separate files so that they are easier to manage and such that I don't have to look through hundreds to
7
6719
by: mark4asp | last post by:
How can I prevent Caching of JavaScript and CSS files ONLY when I deploy a new application? I only want to force a refresh the first time the client uses the new build. For instance, I'm told I can do it with javascript by including a version number as a querystring like this: <script type="text/javascript" src="../javascript/menu.js?v=2"></ script> However that won't solve the problem of the css files.
5
1600
by: Raman | last post by:
Hi All, We have an old code base which (unfortunatelty) has some C files that include other C files:e.g File.c ===== #include<stdio.h> .. void someFunc(){
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.