Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Dwight S #1
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
-
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... -
#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: ... -
#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: ... -
#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: ... -
#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... -
Michael Fesser #2
Re: PHP Include Command
..oO(Dwight S)
First, it should be <?php, not only <?. Short open tags are unreliable,>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"); ?>
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
-
Dwight S #3
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



Reply With Quote

