can't include 'http...foo.php', but can include 'http...foo.txt'

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default can't include 'http...foo.php', but can include 'http...foo.txt'

    This seems weird, but when I use the following code,

    include 'http://www.foo.com/includes.php';

    includedfunction();

    I am told that it is a call to an undefined function, but
    'includedfunction' is on the server.

    the following includes work fine, and the run the called function with
    no trouble:

    include 'http://www.foo.com/includes.phtml';
    include 'http://www.foo.com/includes.txt';

    all three include.php,.phtml & .txt are on the server and are exactly
    identical. I am running php version 4.1.1. Anyone have any ideas?
    paul13 Guest

  2. Similar Questions and Discussions

    1. Strange Include problems: Repeat regions will Not workwith include file
      I have a strange problem. I have an Index.asp page and on that page I have a poll that is displays. This poll is located in a sub folder, so to call...
    2. proper way to include constants; as module or include file?
      I am developing a new perl module that uses constants with regular expressions. What is the proper way to offer this file? For example, my perl...
    3. Every time i try to display records on an include page i get repeats of the whole include
      hi guys and ladies, here is my problem and i would be most grateful if any one could shed some light on this please: i have a default.asp page...
    4. #26259 [Opn->Bgs]: relative include path not working with include() from shell command line execut
      ID: 26259 Updated by: iliaa@php.net Reported By: orsaini at allainet dot com -Status: Open +Status: ...
    5. #26259 [NEW]: relative include path not working with include() from shell command line execut
      From: orsaini at allainet dot com Operating system: Lunux Apache 2.0.47 PHP version: 4.3.2 PHP Bug Type: ...
  3. #2

    Default can't include 'http...foo.php', but can include 'http...foo.txt'

    This seems weird, but when I use the following code,

    include 'http://www.foo.com/includes.php';

    includedfunction();

    I am told that it is a call to an undefined function, but
    'includedfunction' is on the server.

    the following includes work fine, and the run the called function with
    no trouble:

    include 'http://www.foo.com/includes.phtml';
    include 'http://www.foo.com/includes.txt';

    all three include.php,.phtml & .txt are on the server and are exactly
    identical. I am running php version 4.1.1. Anyone have any ideas?
    paul13 Guest

  4. #3

    Default can't include 'http...foo.php', but can include 'http...foo.txt'

    This seems weird, but when I use the following code,

    include 'http://www.foo.com/includes.php';

    includedfunction();

    I am told that it is a call to an undefined function, but
    'includedfunction' is on the server.

    the following includes work fine, and the run the called function with
    no trouble:

    include 'http://www.foo.com/includes.phtml';
    include 'http://www.foo.com/includes.txt';

    all three include.php,.phtml & .txt are on the server and are exactly
    identical. I am running php version 4.1.1. Anyone have any ideas?
    paul13 Guest

  5. #4

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    In article <768682d0.0308190004.dd35f7c@posting.google.com> ,
    [email]googlegroups@paul13.com[/email] (paul13) wrote:
    > This seems weird, but when I use the following code,
    >
    > include 'http://www.foo.com/includes.php';
    >
    > includedfunction();
    >
    > I am told that it is a call to an undefined function, but
    > 'includedfunction' is on the server.
    The include statement is include()'ing the _output_ of
    [url]http://www.foo.com/includes.php[/url], not the contents of the file.

    To demonstrate thist point, load [url]http://www.foo.com/includes.php[/url] in your
    browser and look for your function definitions. Then load
    [url]http://www.foo.com/includes.txt[/url]. You'll see the difference.

    hth

    --
    Bulworth : [email]funha@fung.arg[/email] | My email address is ROT13 encoded, decode to mail
    --------------------------|--------------------------------------------------
    <http://www.phplabs.com/> | PHP scripts and thousands of webmaster resources!
    Senator Jay Billington Bulworth Guest

  6. #5

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    In article <768682d0.0308190004.dd35f7c@posting.google.com> ,
    [email]googlegroups@paul13.com[/email] (paul13) wrote:
    > This seems weird, but when I use the following code,
    >
    > include 'http://www.foo.com/includes.php';
    >
    > includedfunction();
    >
    > I am told that it is a call to an undefined function, but
    > 'includedfunction' is on the server.
    The include statement is include()'ing the _output_ of
    [url]http://www.foo.com/includes.php[/url], not the contents of the file.

    To demonstrate thist point, load [url]http://www.foo.com/includes.php[/url] in your
    browser and look for your function definitions. Then load
    [url]http://www.foo.com/includes.txt[/url]. You'll see the difference.

    hth

    --
    Bulworth : [email]funha@fung.arg[/email] | My email address is ROT13 encoded, decode to mail
    --------------------------|--------------------------------------------------
    <http://www.phplabs.com/> | PHP scripts and thousands of webmaster resources!
    Senator Jay Billington Bulworth Guest

  7. #6

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    In article <768682d0.0308190004.dd35f7c@posting.google.com> ,
    [email]googlegroups@paul13.com[/email] (paul13) wrote:
    > This seems weird, but when I use the following code,
    >
    > include 'http://www.foo.com/includes.php';
    >
    > includedfunction();
    >
    > I am told that it is a call to an undefined function, but
    > 'includedfunction' is on the server.
    The include statement is include()'ing the _output_ of
    [url]http://www.foo.com/includes.php[/url], not the contents of the file.

    To demonstrate thist point, load [url]http://www.foo.com/includes.php[/url] in your
    browser and look for your function definitions. Then load
    [url]http://www.foo.com/includes.txt[/url]. You'll see the difference.

    hth

    --
    Bulworth : [email]funha@fung.arg[/email] | My email address is ROT13 encoded, decode to mail
    --------------------------|--------------------------------------------------
    <http://www.phplabs.com/> | PHP scripts and thousands of webmaster resources!
    Senator Jay Billington Bulworth Guest

  8. #7

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    On 19 Aug 2003 01:04:29 -0700, [email]googlegroups@paul13.com[/email] (paul13) wrote:
    >This seems weird, but when I use the following code,
    >
    >include 'http://www.foo.com/includes.php';
    >
    >includedfunction();
    >
    >I am told that it is a call to an undefined function, but
    >'includedfunction' is on the server.
    >
    >the following includes work fine, and the run the called function with
    >no trouble:
    >
    >include 'http://www.foo.com/includes.phtml';
    >include 'http://www.foo.com/includes.txt';
    >
    When you include it using a URL as above, the file is served from the
    webserver which parses the php script as it has a php extension. With
    the other extensions, the php code isn't parsed. Try looking at the
    URL with a browser and you'll see what I mean.

    Your include path should be a physical path to the file e.g:
    include ('/usr/local/htdocs/includes/includes.php');
    That way you can use a .php extension and nobody will see your source
    code.

    EMS
    EMS Guest

  9. #8

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    On 19 Aug 2003 01:04:29 -0700, [email]googlegroups@paul13.com[/email] (paul13) wrote:
    >This seems weird, but when I use the following code,
    >
    >include 'http://www.foo.com/includes.php';
    >
    >includedfunction();
    >
    >I am told that it is a call to an undefined function, but
    >'includedfunction' is on the server.
    >
    >the following includes work fine, and the run the called function with
    >no trouble:
    >
    >include 'http://www.foo.com/includes.phtml';
    >include 'http://www.foo.com/includes.txt';
    >
    When you include it using a URL as above, the file is served from the
    webserver which parses the php script as it has a php extension. With
    the other extensions, the php code isn't parsed. Try looking at the
    URL with a browser and you'll see what I mean.

    Your include path should be a physical path to the file e.g:
    include ('/usr/local/htdocs/includes/includes.php');
    That way you can use a .php extension and nobody will see your source
    code.

    EMS
    EMS Guest

  10. #9

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    why does include(includes/includers.php) work fine for pages stored on
    the same server?

    Paul

    Senator Jay Billington Bulworth <funha@fung.arg> wrote in message news:<funha-B7D472.04360919082003@clmboh1-nws4-ge0.columbus.rr.com>...
    > In article <768682d0.0308190004.dd35f7c@posting.google.com> ,
    > [email]googlegroups@paul13.com[/email] (paul13) wrote:
    >
    > > This seems weird, but when I use the following code,
    > >
    > > include 'http://www.foo.com/includes.php';
    > >
    > > includedfunction();
    > >
    > > I am told that it is a call to an undefined function, but
    > > 'includedfunction' is on the server.
    >
    > The include statement is include()'ing the _output_ of
    > [url]http://www.foo.com/includes.php[/url], not the contents of the file.
    >
    > To demonstrate thist point, load [url]http://www.foo.com/includes.php[/url] in your
    > browser and look for your function definitions. Then load
    > [url]http://www.foo.com/includes.txt[/url]. You'll see the difference.
    >
    > hth
    paul13 Guest

  11. #10

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    >
    > Your include path should be a physical path to the file e.g:
    > include ('/usr/local/htdocs/includes/includes.php');
    > That way you can use a .php extension and nobody will see your source
    > code.
    >
    > EMS
    How do I use the physical location for a page on another machine?

    'http://www.foo.com/usr/local/htdocs/includes/includes.php'

    with whatever is the acurate physical location following the .com?

    Paul
    paul13 Guest

  12. #11

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    >
    > Your include path should be a physical path to the file e.g:
    > include ('/usr/local/htdocs/includes/includes.php');
    > That way you can use a .php extension and nobody will see your source
    > code.
    >
    > EMS
    How do I use the physical location for a page on another machine?

    'http://www.foo.com/usr/local/htdocs/includes/includes.php'

    with whatever is the acurate physical location following the .com?

    Paul
    paul13 Guest

  13. #12

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    [email]googlegroups@paul13.com[/email] (paul13) wrote in message news:<768682d0.0309011426.b832fec@posting.google.c om>...
    >
    > How do I use the physical location for a page on another machine?
    >
    > 'http://www.foo.com/usr/local/htdocs/includes/includes.php'
    >
    > with whatever is the acurate physical location following the .com?
    >
    > Paul
    I sure hope that URL is 404.

    When you include a valid external URL you're including what that URL
    outputs (should be obvious)? So pull up
    'http://www.foo.com/includes.php' in your browser. View the source.
    That's what you're including.
    surely this is covered here:
    [url]http://us3.php.net/manual/en/function.include.php[/url] ?
    BKDotCom Guest

  14. #13

    Default Re: can't include 'http...foo.php', but can include 'http...foo.txt'

    [email]googlegroups@paul13.com[/email] (paul13) wrote in message news:<768682d0.0309011426.b832fec@posting.google.c om>...
    >
    > How do I use the physical location for a page on another machine?
    >
    > 'http://www.foo.com/usr/local/htdocs/includes/includes.php'
    >
    > with whatever is the acurate physical location following the .com?
    >
    > Paul
    I sure hope that URL is 404.

    When you include a valid external URL you're including what that URL
    outputs (should be obvious)? So pull up
    'http://www.foo.com/includes.php' in your browser. View the source.
    That's what you're including.
    surely this is covered here:
    [url]http://us3.php.net/manual/en/function.include.php[/url] ?
    BKDotCom Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139