Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12339 > unrolled thread

Include gives warning

Started byrichard <noreply@example.com>
First post2013-12-21 10:36 -0500
Last post2013-12-22 16:11 +0100
Articles 10 — 8 participants

Back to article view | Back to comp.lang.php


Contents

  Include gives warning richard <noreply@example.com> - 2013-12-21 10:36 -0500
    Re: Include gives warning richard <noreply@example.com> - 2013-12-21 11:03 -0500
    Re: Include gives warning Derek Turner <frderek@cesmail.net> - 2013-12-21 18:26 +0000
      Re: Include gives warning Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2013-12-21 14:02 -0500
      Re: Include gives warning Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-21 20:24 +0100
      Re: Include gives warning richard <noreply@example.com> - 2013-12-21 14:36 -0500
        Re: Include gives warning "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-12-21 22:09 +0000
        Re: Include gives warning Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-21 23:46 +0000
        Re: Include gives warning Evan Platt <evan@theobvious.espphotography.com.invalid> - 2013-12-21 19:42 -0800
    Re: Include gives warning Luuk <luuk@invalid.lan> - 2013-12-22 16:11 +0100

#12339 — Include gives warning

Fromrichard <noreply@example.com>
Date2013-12-21 10:36 -0500
SubjectInclude gives warning
Message-ID<1ntef0hrqukct$.1ps7dz7dar5gu$.dlg@40tude.net>
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/

[toc] | [next] | [standalone]


#12340

Fromrichard <noreply@example.com>
Date2013-12-21 11:03 -0500
Message-ID<yclia1b91kl2.1j9j8dtadzxs2.dlg@40tude.net>
In reply to#12339
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.

[toc] | [prev] | [next] | [standalone]


#12341

FromDerek Turner <frderek@cesmail.net>
Date2013-12-21 18:26 +0000
Message-ID<bhm4qmFev65U1@mid.individual.net>
In reply to#12339
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.

[toc] | [prev] | [next] | [standalone]


#12342

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2013-12-21 14:02 -0500
Message-ID<DBltu.13810$m_6.8073@fx25.iad>
In reply to#12341
On Saturday 21 December 2013 13:26, in comp.lang.php, "Derek Turner"
<frderek@cesmail.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

[toc] | [prev] | [next] | [standalone]


#12343

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-12-21 20:24 +0100
Message-ID<1435585.JWNJUdetN8@PointedEars.de>
In reply to#12341
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-include>
| [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

[toc] | [prev] | [next] | [standalone]


#12344

Fromrichard <noreply@example.com>
Date2013-12-21 14:36 -0500
Message-ID<rgz3zw0emco9.133owtqbiftzi.dlg@40tude.net>
In reply to#12341
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.

[toc] | [prev] | [next] | [standalone]


#12345

From"Beauregard T. Shagnasty" <a.nony.mous@example.invalid>
Date2013-12-21 22:09 +0000
Message-ID<l953jl$hgl$1@dont-email.me>
In reply to#12344
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

[toc] | [prev] | [next] | [standalone]


#12346

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-12-21 23:46 +0000
Message-ID<l95980$es5$1@dont-email.me>
In reply to#12344
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@gmail.com

[toc] | [prev] | [next] | [standalone]


#12347

FromEvan Platt <evan@theobvious.espphotography.com.invalid>
Date2013-12-21 19:42 -0800
Message-ID<jsncb9p82tt25c7js1i0dq9muhp9q0qe40@4ax.com>
In reply to#12344
On Sat, 21 Dec 2013 14:36:07 -0500, richard <noreply@example.com>
wrote:

>Nice to see you got bashed for being so intelligent.

Oh, the irony.
-- 
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.

[toc] | [prev] | [next] | [standalone]


#12348

FromLuuk <luuk@invalid.lan>
Date2013-12-22 16:11 +0100
Message-ID<j2cjoa-5rh.ln1@luuk.invalid.lan>
In reply to#12339
On 21-12-2013 16:36, 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?
>


you should have told what warning you get.

But visiting your page revealed it:
Warning: include(http://mroldies.net/artists/artists.php) 
[function.include]: failed to open stream: HTTP request failed! HTTP/1.1 
404 Not Found in 
/home2/richbull/public_html/mroldies.net/artists/index.php on line 16

Googling for '404 Warning: include  [function.include]: failed to open 
stream: HTTP request failed! ' found other pages with same error here:
http://lcmstarget.tjc.edu/Student/StudentHandbook.php

But this site works:
http://www.tjc.edu/Student/StudentHandbook.php

Some working examples, and the documentation can be found here:
http://www.php.net/manual/en/function.include.php

But you will get a 404 when the page is not found.....

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web