Paying for simple PHP fix

Discussion in 'PHP' started by feonix, Dec 1, 2008.

  1. #1
    Fixed it myself. I had to add..

    include($phpbb_root_path . 'common.' . $phpEx);

    To the top. The functions_user.php file relied on things in common. So obvious now. I spent hours on this one.

    Thanks for all the help anyway.
     
    feonix, Dec 1, 2008 IP
  2. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Hi,

    I don't think that URL for the functions_user.php file will work since it's stored on a local drive.

    Try:

    This: include("/forum/includes/functions_user.php");
    Or this: include("/includes/functions_user.php");
    Or this: include("../includes/functions_user.php");
    Or, at last, this: include("includes/functions_user.php");
     
    elias_sorensen, Dec 1, 2008 IP
  3. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #3
    elias_sorensen...
    include function can include file with full path address...
    for more info, read this
    http://id2.php.net/manual/en/ini.core.php#ini.include-path
    Code (markup):
     
    misbah, Dec 1, 2008 IP
  4. feonix

    feonix Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes it's finding the include file just fine. No error message about "group_user_add" being an undefined function. The script just runs and quits without any output and like I said if I put a print line after the call to the function it doesn't output but if I put it before it does. So it seems to be like the function isn't working right and is crashing or something weird. I know this function is commonly used to do this though.

    If someone can fix this for me here in the forums I'll pay you as well.

    Here are a couple different scripts that use this function without any problems and at the bottom the full function text....

    and...

    Full function from functions_user.php

     
    feonix, Dec 1, 2008 IP
  5. mallorcahp

    mallorcahp Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It looks like it might be expecting an array for the $user_id

    try this :

    
    <?php
    $group_id = 5;
    $user_id = array();
    $user_id[] = 54;
    
    include("C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/forum/includes/functions_user.php");
    
    if ($error = group_user_add($group_id, $user_id))
    {
    trigger_error($error);
    }
    
    ?> 
    
    PHP:
     
    mallorcahp, Dec 1, 2008 IP