RE: [PHP-DB] Problem with include()
Could it be windows doesn't like the '/' in the path. OK on a webpage, but not directly into the filesystem? Peter -Original Message- From: TorrentUK [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 12:47 To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem with include() Can anyone spot why I get the error Warning: Failed opening 'd:/www/htdocs/ski-info-online/poll.php?id=KnChooseBoots' for inclusion (include_path='') in d:\WWW\htdocs/ski-info-online/skiKnSkiBoots.php on line 113 Here is the calling line: ?php include($DOCUMENT_ROOT . /ski-info-online/poll.php?id=KnChooseBoots); ? If I call poll.php?id=KnChooseBoots from the browser it works (exactly the same path). If I drop the argument it works (i.e. php include($DOCUMENT_ROOT . /ski-info-online/poll.php); ). So what the blazes is happening? The manual reads: /* Works. */ include (http://someserver/file.php?varone=1vartwo=2;); and... require($DOCUMENT_ROOT . /header.html); which are the techniques I think I have used. Thanks for any help -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with include()
Hi Peter, I'll be surprised if that's it as I am running this through an Apache server which insists on the \ being / Also all references to my images are / and they work fine. In fact, I think I mentioned, it calls the poll.php if I drop the argument part (?id=KnChooseBoots). It's all very strange. Thanks for the response. I might just give your suggestion just to be sure. Rgds -torrent Peter Lovatt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could it be windows doesn't like the '/' in the path. OK on a webpage, but not directly into the filesystem? Peter -Original Message- From: TorrentUK [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 12:47 To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem with include() Can anyone spot why I get the error Warning: Failed opening 'd:/www/htdocs/ski-info-online/poll.php?id=KnChooseBoots' for inclusion (include_path='') in d:\WWW\htdocs/ski-info-online/skiKnSkiBoots.php on line 113 Here is the calling line: ?php include($DOCUMENT_ROOT . /ski-info-online/poll.php?id=KnChooseBoots); ? If I call poll.php?id=KnChooseBoots from the browser it works (exactly the same path). If I drop the argument it works (i.e. php include($DOCUMENT_ROOT . /ski-info-online/poll.php); ). So what the blazes is happening? The manual reads: /* Works. */ include (http://someserver/file.php?varone=1vartwo=2;); and... require($DOCUMENT_ROOT . /header.html); which are the techniques I think I have used. Thanks for any help -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Problem with include()
That sounds the likely answer to me too - you don't generally try to send a parameter to something you're including. if you're just trying to go to that page after executing some code, do a print Location:yadayadayada...?id=KnChooseBoots -Original Message- From: Bruno Gimenes Pereti [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 13:41 To: PHP-DB Subject: Re: [PHP-DB] Problem with include() Does include accept parameter? I have never tried. I think php will try to find a file called poll.php?id=KnChooseBoots not a file called poll and give argument for it. Also why do you need to put the parameter if the variable id is already set? Bruno. - Original Message - From: TorrentUK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 11:24 AM Subject: Re: [PHP-DB] Problem with include() Hi Peter, I'll be surprised if that's it as I am running this through an Apache server which insists on the \ being / Also all references to my images are / and they work fine. In fact, I think I mentioned, it calls the poll.php if I drop the argument part (?id=KnChooseBoots). It's all very strange. Thanks for the response. I might just give your suggestion just to be sure. Rgds -torrent Peter Lovatt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could it be windows doesn't like the '/' in the path. OK on a webpage, but not directly into the filesystem? Peter -Original Message- From: TorrentUK [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 12:47 To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem with include() Can anyone spot why I get the error Warning: Failed opening 'd:/www/htdocs/ski-info-online/poll.php?id=KnChooseBoots' for inclusion (include_path='') in d:\WWW\htdocs/ski-info-online/skiKnSkiBoots.php on line 113 Here is the calling line: ?php include($DOCUMENT_ROOT . /ski-info-online/poll.php?id=KnChooseBoots); ? If I call poll.php?id=KnChooseBoots from the browser it works (exactly the same path). If I drop the argument it works (i.e. php include($DOCUMENT_ROOT . /ski-info-online/poll.php); ). So what the blazes is happening? The manual reads: /* Works. */ include (http://someserver/file.php?varone=1vartwo=2;); and... require($DOCUMENT_ROOT . /header.html); which are the techniques I think I have used. Thanks for any help -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with include()
According to the php manual it can pass args and values. The value I pass in through the $id then determines what poll is presented to the visitor (poll.php opens a file called $id.txt, which contains the poll's title, values, etc). So I set the id variable depending on where the poll script is invoked (i.e. what will the visitor be voting for at this point). I'm confused. I going to have to think of a work-around (sometimes known as a kludge :) ) Thanks -torrent Bruno Gimenes Pereti [EMAIL PROTECTED] wrote in message 008a01c16c48$d3ba94b0$[EMAIL PROTECTED]">news:008a01c16c48$d3ba94b0$[EMAIL PROTECTED]... Does include accept parameter? I have never tried. I think php will try to find a file called poll.php?id=KnChooseBoots not a file called poll and give argument for it. Also why do you need to put the parameter if the variable id is already set? Bruno. - Original Message - From: TorrentUK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 11:24 AM Subject: Re: [PHP-DB] Problem with include() Hi Peter, I'll be surprised if that's it as I am running this through an Apache server which insists on the \ being / Also all references to my images are / and they work fine. In fact, I think I mentioned, it calls the poll.php if I drop the argument part (?id=KnChooseBoots). It's all very strange. Thanks for the response. I might just give your suggestion just to be sure. Rgds -torrent Peter Lovatt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could it be windows doesn't like the '/' in the path. OK on a webpage, but not directly into the filesystem? Peter -Original Message- From: TorrentUK [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 12:47 To: [EMAIL PROTECTED] Subject: [PHP-DB] Problem with include() Can anyone spot why I get the error Warning: Failed opening 'd:/www/htdocs/ski-info-online/poll.php?id=KnChooseBoots' for inclusion (include_path='') in d:\WWW\htdocs/ski-info-online/skiKnSkiBoots.php on line 113 Here is the calling line: ?php include($DOCUMENT_ROOT . /ski-info-online/poll.php?id=KnChooseBoots); ? If I call poll.php?id=KnChooseBoots from the browser it works (exactly the same path). If I drop the argument it works (i.e. php include($DOCUMENT_ROOT . /ski-info-online/poll.php); ). So what the blazes is happening? The manual reads: /* Works. */ include (http://someserver/file.php?varone=1vartwo=2;); and... require($DOCUMENT_ROOT . /header.html); which are the techniques I think I have used. Thanks for any help -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with include()
Try this way: in your php script: $foo = something; include(path/file.php); print $bar; in your file.php (included): globals $foo; $bar = $foo. working; I think this example will help... Bruno. - Original Message - From: TorrentUK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 1:16 PM Subject: Re: [PHP-DB] Problem with include() According to the php manual it can pass args and values. The value I pass in through the $id then determines what poll is presented to the visitor (poll.php opens a file called $id.txt, which contains the poll's title, values, etc). So I set the id variable depending on where the poll script is invoked (i.e. what will the visitor be voting for at this point). I'm confused. I going to have to think of a work-around (sometimes known as a kludge :) ) Thanks -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with include()
On Tuesday 13 November 2001 23:16, TorrentUK wrote: According to the php manual it can pass args and values. I think this is only true *if* you're including a remote file, ie through HTTP. The value I pass in through the $id then determines what poll is presented to the visitor (poll.php opens a file called $id.txt, which contains the poll's title, values, etc). So I set the id variable depending on where the poll script is invoked (i.e. what will the visitor be voting for at this point). I'm confused. I going to have to think of a work-around (sometimes known as a kludge :) ) I mentioned, it calls the poll.php if I drop the argument part (?id=KnChooseBoots). It's all very strange. That's because the'argument' part (which you can't use when including local files) contains a question mark '?' which confuses Windows filesystem as it stands for a single wildcard character. hth -- Jason Wong Gremlins Associates www.gremlins.com.hk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Problem with include()
Bruno, I just come on to post a message saying I got it workingexactly the way you mention. Problem I had was I adhered too closely to an example in the manual :) Thanks for your help. -torrent Bruno Gimenes Pereti [EMAIL PROTECTED] wrote in message 00c201c16c5b$1028fd30$[EMAIL PROTECTED]">news:00c201c16c5b$1028fd30$[EMAIL PROTECTED]... Try this way: in your php script: $foo = something; include(path/file.php); print $bar; in your file.php (included): globals $foo; $bar = $foo. working; I think this example will help... Bruno. - Original Message - From: TorrentUK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 1:16 PM Subject: Re: [PHP-DB] Problem with include() According to the php manual it can pass args and values. The value I pass in through the $id then determines what poll is presented to the visitor (poll.php opens a file called $id.txt, which contains the poll's title, values, etc). So I set the id variable depending on where the poll script is invoked (i.e. what will the visitor be voting for at this point). I'm confused. I going to have to think of a work-around (sometimes known as a kludge :) ) Thanks -torrent -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP-DB] Problem with include()
The manual reads include (\http://someserver/file.php?varone=1vartwo=2\;); and... require($DOCUMENT_ROOT . \/header.html\); As you can see the upper one among the above line refers to opening a remote file for inclusion via http. If it the server is somewhat properly configured you will not be able to download the script source for execution from there, so it makes sense to pass parameters. Which HTTP fortunately supports. Unfortunately, local file systems do not necessarily support passing parameters to files being openend for read access. Wich wouldn\'t make sense, because it\'s just being read, not executed. It will tough be executed _after_ being read... As a part of the current runtime environment, sharing the same variable namespace, and stuff. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]