Func.php stuff not working

  1. 2 years ago
    Edited 2 years ago by Erica

    I'm having trouble adding eTCG stuff to my trade post. I'm trying to start with a 1Up page. Right now I'm just trying to add activity and trade logs. I have this as my 1up.php page:

    <?php include('/home2/lawschq6/public_html/tcg/header.php'); ?>
    <?php define('VALID_INC', TRUE); include '/public_html/tcg/func.php'; ?>
    
    <h1>1Up</h1>
    
    <p><b>Activity Log</b>
    <p><?php echo get_logs('1Up','activitylog'); ?>
    <p><b>Trade Log</b>
    <?php echo get_logs('1Up','tradelog'); ?>
    
     <?php include('/home2/lawschq6/public_html/tcg/footer.php'); ?>

    I see 1Up formatted correctly, then Activity Log, and everything else is blank. I don't even see the Trade Log text.

    Errors I'm getting (and why the Denver stuff is there...I don't know. that's not even my time zone):

    [28-Jun-2015 19:57:03 America/Denver] PHP Warning:  include(): Failed opening '/public_html/tcg/func.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/1up.php on line 2
    [28-Jun-2015 19:57:03 America/Denver] PHP Fatal error:  Call to undefined function get_logs() in /home2/lawschq6/public_html/tcg/1up.php on line 7
    [28-Jun-2015 19:57:05 America/Denver] PHP Warning:  include(): Failed opening '/public_html/tcg/func.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/1up.php on line 2
    [28-Jun-2015 19:57:05 America/Denver] PHP Fatal error:  Call to undefined function get_logs() in /home2/lawschq6/public_html/tcg/1up.php on line 7

    I'm also having weird path issues. I have to keep changing them for different pages to get them to show. For example, on my index I need to have "<?php include('header.php'); ?>" for my layout to work. But on 1up.php I need it to be "<?php include('/home2/lawschq6/public_html/tcg/header.php'); ?>" to work. And sometimes it needs to be only the /public_html/ and stuff after to work. I have no idea why that is.

    Last time I played TCGs needtakehave hosted me and all the eTCG was already done. I've never had to set it up before. I'm bad at coding and it sucks >.<

    OMG I solved it haha! It was a path issue in the func.php file:

    require_once('/home2/lawschq6/public_html/tcg/etcg/config.php'); made it work. Hee. I'm so psyched.

  2. Bloo

    29 Jun 2015 Administrator kablooey.net

    Hi Erica!

    That error indicates that the script is not seeing your 'func.php' file - most likely due to the path issues that you mentioned. The path which you're using for 'func.php' is definitely not correct. You need to either use the full, absolute path (ie. '/home2/lawschq6/public_html/tcg/func.php') or a relative path (ie. just 'func.php'). That relative path will only work if the file that you're including is located in the same directory. Assuming everything is in your "/home2/lawschq6/public_html/tcg/" directory, the shorter relative path should work fine.

    Try changing all of your paths to either use absolute or relative paths (remove any instances of '/public_html/tcg/') and let me know what errors you get at that point, if any~

  3. I tried both making them all relative and all absolute, and both ways it's just a blank spot in the layout; not even the words "1Up" and "Activity Log." It looks like this: -image-

    These are the errors from after I edited it both ways:

    [29-Jun-2015 12:20:15 America/Denver] PHP Warning:  require_once(/public_html/tcg/etcg/config.php): failed to open stream: No such file or directory in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:20:15 America/Denver] PHP Fatal error:  require_once(): Failed opening required '/public_html/tcg/etcg/config.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:20:18 America/Denver] PHP Warning:  require_once(/public_html/tcg/etcg/config.php): failed to open stream: No such file or directory in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:20:18 America/Denver] PHP Fatal error:  require_once(): Failed opening required '/public_html/tcg/etcg/config.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:21:37 America/Denver] PHP Warning:  require_once(/public_html/tcg/etcg/config.php): failed to open stream: No such file or directory in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:21:37 America/Denver] PHP Fatal error:  require_once(): Failed opening required '/public_html/tcg/etcg/config.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:21:40 America/Denver] PHP Warning:  require_once(/public_html/tcg/etcg/config.php): failed to open stream: No such file or directory in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:21:40 America/Denver] PHP Fatal error:  require_once(): Failed opening required '/public_html/tcg/etcg/config.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:24:26 America/Denver] PHP Warning:  require_once(/public_html/tcg/etcg/config.php): failed to open stream: No such file or directory in /home2/lawschq6/public_html/tcg/func.php on line 3
    [29-Jun-2015 12:24:26 America/Denver] PHP Fatal error:  require_once(): Failed opening required '/public_html/tcg/etcg/config.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /home2/lawschq6/public_html/tcg/func.php on line 3
  4. OMG I solved it haha! It was a path issue in the func.php file:

    require_once('/home2/lawschq6/public_html/tcg/etcg/config.php'); made it work. Hee. I'm so psyched.

or Sign Up to reply!