1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Why wont this work

Discussion in 'PHP' started by Jim bob 9 pants, Apr 21, 2005.

  1. #1
    Hello all,

    I have created a folder on my root called articles, into that i have created a page using my normal template and called this page test.php when I type the path (http://www.visitdevonandcornwall.com/articles/test.php) into a browser i get this

    Fatal error: main(): Failed opening required 'Connections/accomm.php'

    Can anyone help me out please :(
     
    Jim bob 9 pants, Apr 21, 2005 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sounds like a hardcode path in the template. Were all previous pages in the root?

    Look out for some code including a file relatively. Because you went down the directory tree it can't find it no more...
     
    T0PS3O, Apr 21, 2005 IP
  3. Jim bob 9 pants

    Jim bob 9 pants Peon

    Messages:
    890
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yep, all the previous pages are in the root
     
    Jim bob 9 pants, Apr 21, 2005 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    We'll have to see some of the .php file's code to help you out in detail.
     
    T0PS3O, Apr 21, 2005 IP
  5. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Find....

    require("Connections/accomm.php");

    Change to...


    require("../Connections/accomm.php");
     
    noppid, Apr 21, 2005 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    As Noppid suggests:

    <?php require_once('Connections/accomm.php'); ?>

    to

    <?php require_once('../Connections/accomm.php'); ?>

    To make up for the folder change...

    PS after fixing it you might want to obscure some of the paths posted to avoid evil eyes...
     
    T0PS3O, Apr 21, 2005 IP
    Jim bob 9 pants likes this.
  7. Jim bob 9 pants

    Jim bob 9 pants Peon

    Messages:
    890
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You stars!!!

    Thank you, so that makes it look further up the root (or down)
     
    Jim bob 9 pants, Apr 21, 2005 IP
  8. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #8
    .. tells it the parent folder, then it looks down from there for the given path.

    . is the contents of a folder and the current location. .. is the parent.
     
    noppid, Apr 21, 2005 IP