Start a Chat Sales: 0800 862 0890 Client Area
Results 1 to 6 of 6

Thread: PHP Includes Problem

  1. #1
    altom55 is offline new member
    Join Date
    May 2012
    Posts
    3

    Default PHP Includes Problem

    The last few days Ive spent trying to get a php include to work on the index page of my site.

    I have a folder with a file that Im trying to call but it does not show up. Hosting support cannot help me with code, so Ill ask here.

    Ive tried it with all sorts of dots and forward slashes combinations but the php include does not work. My site is an HTML site, maybe thats a problem but I was told this is perfectly OK.

    I think this is the right path for the index page - I think


    Any sort of help would be much appreciated
    Regards A
    Last edited by altom55; 31-05-12 at 02:45 PM. Reason: Insert Code

  2. #2
    Rachael is offline Marketing Team
    Join Date
    Feb 2011
    Posts
    434

    Default

    Hello,

    We will need some details from you in order to look into this. It would be great if you could provide us with the details of the actual directory for which you are facing the issue. You can raise a support ticket and mention the directory details, also mention the url for which you are facing the issue. We will update the ticket as soon as possible.

  3. #3
    hockeychap is offline Junior Member
    Join Date
    Mar 2011
    Posts
    13

    Default PHP includes

    A,

    Have just read your post. If I understand your post correctly your trying to use an statement like:
    Code:
    include './functionlibrary/myfunctions.php'
    .

    This code would look for a 'myfunctions.php' file in a 'functionlibrary' directory relative to where your page is.

    The second part of your post seems to say that you are trying to put this statement in an html file. That won't work as .html are straightforward markup files that the server simply transmits. If you want to get the server to include the .php file and then execute its contents before sending the resulting html to the user, you will need to create an initial .php file to put the include statment in and then call that.

    Drop me a PM if that doesn't make any sense or you need any further clarification.

    Cheers
    Justin

  4. #4
    altom55 is offline new member
    Join Date
    May 2012
    Posts
    3

    Default

    I have had no luck with support as this is a "code" related problem and support told me to look elsewhere for an answer. I have tried to put code in this sentence but it deletes the whole page and text too.

  5. #5
    hockeychap is offline Junior Member
    Join Date
    Mar 2011
    Posts
    13

    Default

    A,

    Yep, attaching code can be a problem. I've attached a text file which has some example code for you. You'll need to save the top section as a .php file (typically index.php) and the bottom section as myfunc.php

    Cheers
    Justin
    Attached Files Attached Files

  6. #6
    altom55 is offline new member
    Join Date
    May 2012
    Posts
    3

    Default

    Thanks for that but I mean attaching code in this thread with my text. I dont know how to include it in the message editor

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright 2001-2013 Web Hosting UK. All rights reserved.