Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: PHP script problem

  1. #11
    Junior Member
    Join Date
    Jul 2011
    Posts
    14

    Default

    dots or not the home page does not work. That is not the problem. Any other ideas?

  2. #12
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    Your script isn't even on the home page, which would explain why you don't see it. It's probably because your masterborder for the home page is different from the masterborder used by the other pages. Try adding the script to the home page's masterborder.

  3. #13
    Charles Edmonds
    Guest

    Default Re: PHP script problem

    On Sun, 17 Jul 2011 12:59:40 +0000, RayC wrote:

    > Hey, Charles, I'm seeing spots -- or dots in this case. I think you have
    > one too many in your examples.


    Hi Ray,

    The one or two dots is valid of course.

    Here is one source on it:

    http://en.wikipedia.org/wiki/Path_(computing)

    "Two dots ("..") point upwards in the hierarchy, to indicate the parent
    directory; one dot (".") represents the current directory itself. Both can
    be components of a complex relative path (e.g., "../mark/./bobapples"),
    where "." alone or as the first component of such a relative path
    represents the working directory. (Using "./foo" to refer to a file "foo"
    in the current working directory can sometimes usefully distinguish it from
    a resource "foo" to be found in a default directory or by other means; for
    example, to view a specific version of a manual page instead of the one
    installed in the system.)"


    Given that, you have to take into consideration where the script that is
    running is being called from in relation to other files/directory.

    Since I don't know how the directory layout was on the target site (or
    where the files are), I could only guess and try to point in the right
    direction...

    :-)

    Charles


    --
    -------------------------------------------------------------------------------------------------------
    Charles Edmonds
    cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
    www.clarionproseries.com - "Get ProPath, make your Clarion programs ready
    for Windows 7 and Vista!"
    www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
    www.setupcast.com - "A revolutionary new publishing system for software
    developers - enhanced for SetupBuilder users!"
    www.pagesnip.com - "Print and Save the Web, just the way you want it!"
    www.clarionproseries.com - "Serious tools for Clarion Developers"
    www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
    and Forms - Now with PNG support!
    www.lansrad.com - "Intelligent Solutions for Universal Problems"
    www.fotokiss.com - "World's Best Auction Photo Editor"
    -------------------------------------------------------------------------------------------------------

  4. #14
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Sorry, I may not have been clear. And this may be important for the OP, as well as anyone else that stumbles upon this.

    Your post refers to ONE dot, and said:
    One dot means "look down" into a folder below the one where the page that
    calls it sits. In this case, the "search" folder sits below the level
    where it is called:

    ../search/simple-search-remax-form.php
    But you show TWO dots in your example.


    And then, referring to TWO dots
    Two dots means "up one level". So this script:

    .../search/simple-search-remax-form.php

    means look up one directory level, then down in a directory called "search"
    to find the script. That would be what you use for pages in the <html>
    folder (again assuming the <search> folder is off the root.
    But you show THREE dots in your example.
    Ray Cambpell
    Sounds In Sync
    Linked in

  5. #15
    Junior Member
    Join Date
    Jul 2011
    Posts
    14

    Default

    I don't get it. I have used no dots, one dot, two dots and three dots and none of those work on the home page. When I make a change to the master border it changes on the home page just like the other pages. The only difference is there is no script on the home page.

  6. #16
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    If you are including the script in your MasterBorder, and you use the same MasterBorder for the home page as well as the other pages, one or the other will fail.

    Assuming your folder structure is something like this:
    (And assuming your host calls your root folder "public_html")

    public_html/ index.php
    public_html/html/themcnabs.php
    public_html/html/allyourotherpages.php
    public_html/search/simple-search-remax-form.php

    When you do an include and reference the file like:
    ../search/simple-search-remax-form.php

    This works from all the other pages, because you start in /public_html/html/
    the ../ takes you up a level to /public_html/
    Then /search/ obviously takes you down to the search subfolder.

    But when you reference it from the home page at the /public_html/ folder level, the ../ tries to take you above the root level, which is invalid.

    If you switched the include to be (single-dot)
    ./search/simple-search-remax-form.php
    that should work from the home page, but none of the others.

    I'm surprised when you say that nothing works from the home page. Are you clearing the cache in your browser when you make the change?

    Quick 'n' dirty solution (if the path reference is your problem), is to duplicate your MasterBorder, give it a new name like MasterBorderHome, and use that for the home page, and leave the original MasterBorder for all the other pages.

    Then on MasterBorderHome, change the include to be:
    ./search/simple-search-remax-form.php
    and for the others using the original MasterBorder, leave it as:
    ../search/simple-search-remax-form.php

    And make sure to clear the cache in your browser when you make an update.
    Ray Cambpell
    Sounds In Sync
    Linked in

  7. #17
    Charles Edmonds
    Guest

    Default Re: PHP script problem

    On Sun, 17 Jul 2011 20:05:55 +0000, RayC wrote:

    > Sorry, I may not have been clear. And this may be important for the OP,
    > as well as anyone else that stumbles upon this.


    I think your newsreader is playing tricks on you<g>.

    I did indeed post the correct number of dots (see below for screen captures
    of the posted data)


    > Your post refers to ONE dot, and said:
    >> One dot means "look down" into a folder below the one where the page
    >> that
    >> calls it sits. In this case, the "search" folder sits below the level
    >> where it is called:
    >>
    >> ../search/simple-search-remax-form.php

    > But you show TWO dots in your example.


    See attached OneDot.jpg


    > And then, referring to TWO dots
    >> Two dots means "up one level". So this script:
    >>
    >> .../search/simple-search-remax-form.php
    >>
    >> means look up one directory level, then down in a directory called
    >> "search"
    >> to find the script. That would be what you use for pages in the <html>
    >> folder (again assuming the <search> folder is off the root.

    > But you show THREE dots in your example.


    See attached TwoDots.jpg


    It looks like your newsreader is adding a dot for some reason.

    Charles


    --
    -------------------------------------------------------------------------------------------------------
    Charles Edmonds
    cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
    www.clarionproseries.com - "Get ProPath, make your Clarion programs ready
    for Windows 7 and Vista!"
    www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
    www.setupcast.com - "A revolutionary new publishing system for software
    developers - enhanced for SetupBuilder users!"
    www.pagesnip.com - "Print and Save the Web, just the way you want it!"
    www.clarionproseries.com - "Serious tools for Clarion Developers"
    www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
    and Forms - Now with PNG support!
    www.lansrad.com - "Intelligent Solutions for Universal Problems"
    www.fotokiss.com - "World's Best Auction Photo Editor"
    -------------------------------------------------------------------------------------------------------

  8. #18
    Charles Edmonds
    Guest

    Default Re: PHP script problem

    On Sun, 17 Jul 2011 21:04:47 +0000, themcnabs wrote:

    > I don't get it. I have used no dots, one dot, two dots and three dots
    > and none of those work on the home page. When I make a change to the
    > master border it changes on the home page just like the other pages.
    > The only difference is there is no script on the home page.


    If you have a script that needs to be used on the home page as well as the
    other pages and you have it in the masterborder, then you are going to have
    to make a copy of the masterborder and use that for the home page border.

    The relative path to the files from the home page will be different than it
    will be from the pages in the HTML folder, so you have to account for this
    in your script.

    This is because the home page sits at the top level ( the "root" folder )
    for the site and the other pages sit in the "html" folder.

    The same script string can not point to the files from both places.

    Does that help?

    Charles



    --
    -------------------------------------------------------------------------------------------------------
    Charles Edmonds
    cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
    www.clarionproseries.com - "Get ProPath, make your Clarion programs ready
    for Windows 7 and Vista!"
    www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
    www.setupcast.com - "A revolutionary new publishing system for software
    developers - enhanced for SetupBuilder users!"
    www.pagesnip.com - "Print and Save the Web, just the way you want it!"
    www.clarionproseries.com - "Serious tools for Clarion Developers"
    www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
    and Forms - Now with PNG support!
    www.lansrad.com - "Intelligent Solutions for Universal Problems"
    www.fotokiss.com - "World's Best Auction Photo Editor"
    -------------------------------------------------------------------------------------------------------

  9. #19
    Junior Member
    Join Date
    Jul 2011
    Posts
    14

    Default

    I completely understand how the dots work. Two dots work on all the pages in the HTM directry like it should. No combination of dots work in the home page. This script has been on the home page for a year or so with two dots and it worked. I think that is because the home page directory is the root directory on the web and the the .. is ignored because there is no where to backup to. I just redid the entire master border, that is when it quite working. There must be some setting or maybe the home page is corrupted. When I change anything else on the master border it is changed on the home page and every other page as well.



    Quote Originally Posted by RayC View Post
    If you are including the script in your MasterBorder, and you use the same MasterBorder for the home page as well as the other pages, one or the other will fail.

    Assuming your folder structure is something like this:
    (And assuming your host calls your root folder "public_html")

    public_html/ index.php
    public_html/html/themcnabs.php
    public_html/html/allyourotherpages.php
    public_html/search/simple-search-remax-form.php

    When you do an include and reference the file like:
    ../search/simple-search-remax-form.php

    This works from all the other pages, because you start in /public_html/html/
    the ../ takes you up a level to /public_html/
    Then /search/ obviously takes you down to the search subfolder.

    But when you reference it from the home page at the /public_html/ folder level, the ../ tries to take you above the root level, which is invalid.

    If you switched the include to be (single-dot)
    ./search/simple-search-remax-form.php
    that should work from the home page, but none of the others.

    I'm surprised when you say that nothing works from the home page. Are you clearing the cache in your browser when you make the change?

    Quick 'n' dirty solution (if the path reference is your problem), is to duplicate your MasterBorder, give it a new name like MasterBorderHome, and use that for the home page, and leave the original MasterBorder for all the other pages.

    Then on MasterBorderHome, change the include to be:
    ./search/simple-search-remax-form.php
    and for the others using the original MasterBorder, leave it as:
    ../search/simple-search-remax-form.php

    And make sure to clear the cache in your browser when you make an update.

  10. #20
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    Still, the script is not being published on the home page. Does the home page have a unique masterborder not common to the other pages? If so, try to temporarily give the home page the same masterborder as the other pages... and you'll probably find that the script gets published, right? Maybe create a new home page masterborder and paste the script code into that.

Posting Permissions

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