Including files that have query strings

This is a discussion on Including files that have query strings within the PHP Language forums, part of the PHP Programming Forums category; I am having trouble with accessing files with query strings. For example the code "require 'template.php?102932'" ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-22-2005
theboss3@gmail.com
 
Posts: n/a
Default Including files that have query strings

I am having trouble with accessing files with query strings. For
example the code "require 'template.php?102932'" gives the following
error:


Warning: main(/www/blog/template.php?102932): failed to open stream:
Invalid argument in C:\www\blog\2004\12\27\best-of-2004\index.php on
line 54

Fatal error: main(): Failed opening required
'/www/blog/template.php?102932' (include_path='.;c:\php4\pear') in
C:\www\blog\2004\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.

Reply With Quote
  #2 (permalink)  
Old 01-22-2005
Alvaro G. Vicario
 
Posts: n/a
Default Re: Including files that have query strings

*** theboss3@gmail.com escribió/wrote (21 Jan 2005 23:25:19 -0800):
> Warning: main(/www/blog/template.php?102932): failed to open stream:
> Invalid argument in C:\www\blog\2004\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('template.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
--
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0