Include gives warning [message #184301] |
Sat, 21 December 2013 15:36 |
Mr Oldies
Messages: 241 Registered: October 2013
Karma: 0
|
Senior Member |
|
|
I am attempting to make this work on the home page but the warnings keep
coming.
Anything that is echoed returns nothing or zero.
Because $year is NOT being acquired properly.
So how do I make it work right?
Now let us not dick around with bashing me over my past and current faults.
Or PROBABLE errors such as the use of the iframe.
Bash me, don't expect a reply.
<?php
$year=$_GET['b'];
echo $year;
?>
<div id="wrapper">
<div id="acol" style="float:left; width:3in; height:8in; overflow:auto;
border:solid 2px #f00;">
<?php
include "http://mroldies.net/artists/".$year."artists.php";
echo $art60[1][0];
echo "<br>";
$rows=count($art60);
echo $rows;
?>
</div>
http://mroldies.net/artists/
|
|
|
Re: Include gives warning [message #184302 is a reply to message #184301] |
Sat, 21 December 2013 16:03 |
Mr Oldies
Messages: 241 Registered: October 2013
Karma: 0
|
Senior Member |
|
|
On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
> I am attempting to make this work on the home page but the warnings keep
> coming.
> Anything that is echoed returns nothing or zero.
> Because $year is NOT being acquired properly.
> So how do I make it work right?
>
> Now let us not dick around with bashing me over my past and current faults.
> Or PROBABLE errors such as the use of the iframe.
> Bash me, don't expect a reply.
>
>
>
> <?php
> $year=$_GET['b'];
> echo $year;
> ?>
> <div id="wrapper">
>
> <div id="acol" style="float:left; width:3in; height:8in; overflow:auto;
> border:solid 2px #f00;">
>
> <?php
> include "http://mroldies.net/artists/".$year."artists.php";
>
> echo $art60[1][0];
> echo "<br>";
> $rows=count($art60);
> echo $rows;
> ?>
>
> </div>
>
> http://mroldies.net/artists/
Solved the warning issue.
I had to include the value in the url.
so that the include statement now reads
include "http://mroldies.net/artists/index.php?b=".$year;
The echoed items still nothing or zero.
|
|
|
Re: Include gives warning [message #184303 is a reply to message #184301] |
Sat, 21 December 2013 18:26 |
Derek Turner
Messages: 48 Registered: October 2010
Karma: 0
|
Member |
|
|
On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
> I am attempting to make this work on the home page but the warnings keep
> coming.
> Anything that is echoed returns nothing or zero.
> Because $year is NOT being acquired properly.
> So how do I make it work right?
>
> Now let us not dick around with bashing me over my past and current
> faults.
> Or PROBABLE errors such as the use of the iframe.
> Bash me, don't expect a reply.
>
>
>
> <?php $year=$_GET['b'];
> echo $year;
> ?>
> <div id="wrapper">
>
> <div id="acol" style="float:left; width:3in; height:8in; overflow:auto;
> border:solid 2px #f00;">
>
> <?php include "http://mroldies.net/artists/".$year."artists.php";
>
> echo $art60[1][0];
> echo "<br>";
> $rows=count($art60);
> echo $rows;
> ?>
>
> </div>
>
> http://mroldies.net/artists/
RTFM on the correct way to use include. HINT it has to be the true path to
a file on your server.
|
|
|
Re: Include gives warning [message #184304 is a reply to message #184303] |
Sat, 21 December 2013 19:02 |
Lew Pitcher
Messages: 60 Registered: April 2013
Karma: 0
|
Member |
|
|
On Saturday 21 December 2013 13:26, in comp.lang.php, "Derek Turner"
<frderek(at)cesmail(dot)net> wrote:
> On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
>
>> I am attempting to make this work on the home page but the warnings keep
>> coming.
>> Anything that is echoed returns nothing or zero.
>> Because $year is NOT being acquired properly.
>> So how do I make it work right?
>>
>> Now let us not dick around with bashing me over my past and current
>> faults.
>> Or PROBABLE errors such as the use of the iframe.
>> Bash me, don't expect a reply.
>>
>>
>>
>> <?php $year=$_GET['b'];
>> echo $year;
>> ?>
>> <div id="wrapper">
>>
>> <div id="acol" style="float:left; width:3in; height:8in; overflow:auto;
>> border:solid 2px #f00;">
>>
>> <?php include "http://mroldies.net/artists/".$year."artists.php";
>>
>> echo $art60[1][0];
>> echo "<br>";
>> $rows=count($art60);
>> echo $rows;
>> ?>
>>
>> </div>
>>
>> http://mroldies.net/artists/
>
> RTFM on the correct way to use include. HINT it has to be the true path to
> a file on your server.
Actually, no
http://www.php.net/manual/en/function.include.php
"If "URL include wrappers" are enabled in PHP, you can specify the file to
be included using a URL (via HTTP or other supported wrapper - see
Supported Protocols and Wrappers for a list of protocols) instead of a
local pathname."
While I don't think that richard has a good grasp on programming, web
services, databases, MySQL, Apache, or PHP, it appears that he has paid
more attention to the FM than you have.
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
|
|
|
Re: Include gives warning [message #184305 is a reply to message #184303] |
Sat, 21 December 2013 19:24 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
Derek Turner wrote:
> On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
>> <?php include "http://mroldies.net/artists/".$year."artists.php";
>>
>> […]
>
> RTFM on the correct way to use include. HINT it has to be the true path to
> a file on your server.
No, it does not; it does not even have to be a regular file. However, if
the above is to work, several conditions have to apply:
- allow_url_fopen = 1 (default),
allow_url_include = 1 (the default is 0);
- Either PHP must not parse the resource accessed like that or it must
generate from the parsed resource a PHP script resource;
- The Web server (hardware) must be able to resolve the domain name to an IP
address, using its DNS client (software).
And it still would be comparably inefficient because of the unnecessary
roundtrip.
,-<http://php.net/include>
|
| If "URL include wrappers" [1] are enabled in PHP, you can specify the file
| to be included using a URL (via HTTP or other supported wrapper - see
| Supported Protocols and Wrappers [2] for a list of protocols) instead of a
| local pathname. If the target server interprets the target file as PHP
| code, variables may be passed to the included file using a URL request
| string as used with HTTP GET. This is not strictly speaking the same thing
| as including the file and having it inherit the parent file's variable
| scope; the script is actually being run on the remote server and the
| result is then being included into the local script.
|
| [1] < http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-inc lude>
| [2] <http://www.php.net/manual/en/wrappers.php>
|
`----
PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
|
|
|
Re: Include gives warning [message #184306 is a reply to message #184303] |
Sat, 21 December 2013 19:36 |
Mr Oldies
Messages: 241 Registered: October 2013
Karma: 0
|
Senior Member |
|
|
On 21 Dec 2013 18:26:30 GMT, Derek Turner wrote:
> On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
>
>> I am attempting to make this work on the home page but the warnings keep
>> coming.
>> Anything that is echoed returns nothing or zero.
>> Because $year is NOT being acquired properly.
>> So how do I make it work right?
>>
>> Now let us not dick around with bashing me over my past and current
>> faults.
>> Or PROBABLE errors such as the use of the iframe.
>> Bash me, don't expect a reply.
>>
>>
>>
>> <?php $year=$_GET['b'];
>> echo $year;
>> ?>
>> <div id="wrapper">
>>
>> <div id="acol" style="float:left; width:3in; height:8in; overflow:auto;
>> border:solid 2px #f00;">
>>
>> <?php include "http://mroldies.net/artists/".$year."artists.php";
>>
>> echo $art60[1][0];
>> echo "<br>";
>> $rows=count($art60);
>> echo $rows;
>> ?>
>>
>> </div>
>>
>> http://mroldies.net/artists/
>
> RTFM on the correct way to use include. HINT it has to be the true path to
> a file on your server.
I have experimented with this.
On MY server, as long as the include page is in the same directory, then
include "filename.php" works.
While an absolute path MUST be used if the called file is not in the same
directory.
Nice to see you got bashed for being so intelligent.
|
|
|
Re: Include gives warning [message #184307 is a reply to message #184306] |
Sat, 21 December 2013 22:09 |
Beauregard T. Shagnas
Messages: 154 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
richard the sto0pid wrote:
> I have experimented with this.
Not very much, apparently.
> On MY server, as long as the include page is in the same directory, then
> include "filename.php" works.
Sure.
> While an absolute path MUST be used if the called file is not in the
> same directory.
Not true at all. I use the following method all the time, utilizing my
"include" directory:
include "../include/filename.php";
> Nice to see you got bashed for being so intelligent.
Pity that you will never have as much.
--
-bts
-This space for rent, but the price is high
|
|
|
Re: Include gives warning [message #184308 is a reply to message #184306] |
Sat, 21 December 2013 23:46 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Sat, 21 Dec 2013 14:36:07 -0500, richard wrote:
> ... as long as the include page is in the same directory, then
> include "filename.php" works.
You should have quit while you were ahead.
> While an absolute path MUST be used if the called file is not in the
> same directory.
Because this bit is your normal bullishit.
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|
|
|