Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default PHP Include Command

    I have been playing around with this for about a week now and finally decided
    to seek some help. This is a two part question.

    1) Will you get faster page loads if you code:
    <? include("../../review/stars_only_by_item_id_listing.php?item_id=1"); ?>
    instead of
    <?
    include("http://www.mysite.com/review/stars_only_by_item_id_listing.php?item_id=
    1"); ?>

    2) If the first one listed in number one is a faster page load, then here is
    the real problem.
    Here is how my directory is set up of where the file is that I am using the
    include on: /home/mysite/public_html/reviews/stars_only_by_item_id_listing.php

    I am making have my include command located in:
    www/resort/hotel/nameofresort.php
    My code in the "nameofresort.php" is <?
    include("../../review/stars_only_by_item_id_listing.php?item_id=1"); ?>

    My output is:

    Warning: main(../../review/stars_only_by_item_id_listing.php?item_id=1):
    failed to open stream: No such file or directory in
    /home/mysite/public_html/resort/hotel/ nameofresort.php on line 17

    Warning: main(../../review/stars_only_by_item_id_listing.php?item_id=1):
    failed to open stream: No such file or directory in
    /home/mysite/public_html/resort/hotel/ nameofresort.php on line 17

    Warning: main(): Failed opening
    '../../review/stars_only_by_item_id_listing.php?item_id=1' for inclusion
    (include_path='.') in /home/mysite/public_html/resort/hotel/ nameofresort.php
    on line 17

    I have tried different variations of the accessing the file with no luck. Any
    help anyone could offer would be greatly appreciated.


    Dwight S Guest

  2. Similar Questions and Discussions

    1. include file command
      I have a Dreamweaver site running on ASP _Javascript. I now want to include a file on one of my pages that is on a different server to my machine. Do...
    2. #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: ...
    3. #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: ...
    4. #25434 [Bgs]: Include command with UTF-8 file returns undefined character
      ID: 25434 Updated by: moriyoshi@php.net Reported By: JanKarnik at atlas dot cz Status: Bogus Bug Type: ...
    5. #25434 [NEW]: Include command with UTF-8 file returns undefined character
      From: JanKarnik at atlas dot cz Operating system: Win2K+iis PHP version: 4.3.3 PHP Bug Type: *General Issues Bug...
  3. #2

    Default Re: PHP Include Command

    ..oO(Dwight S)
    >I have been playing around with this for about a week now and finally decided
    >to seek some help. This is a two part question.
    >
    > 1) Will you get faster page loads if you code:
    > <? include("../../review/stars_only_by_item_id_listing.php?item_id=1"); ?>
    > instead of
    > <?
    >include("http://www.mysite.com/review/stars_only_by_item_id_listing.php?item_id=
    >1"); ?>
    First, it should be <?php, not only <?. Short open tags are unreliable,
    because they can be disabled on the server.

    Second, using a URL in an include or require statement is not only
    slower than a direct file access, but will usually lead to a completely
    different result!

    What are you trying to achieve? Do you want to include the source code
    of that file or the final page after the server has parsed the code?

    Micha
    Michael Fesser Guest

  4. #3

    Default Re: PHP Include Command

    I have a site that reviews hotels. Users to the site review the hotel and they
    assign a star rating to it. The "stars_only_by_item_id_listing.php?item_id=1 "
    pulls the 1st hotel in the table and outputs the number of reviews and the
    average of all the star ratings for the 1st hotel. Example Output: (10 reviews)
    ****

    Dwight S 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