Problem with a config php file!

Discussion in 'PHP' started by netnuta, Sep 22, 2006.

  1. #1
    I am having a problem with a php config file as shown below:

    <?
    // database param
    define('DB_TYPE', 'mysql');
    define('DB_SERVER', 'mysql.myfriendslayouts.com');
    define('DB_USER', 'xxxxx');
    define('DB_PASSWORD', 'xxxxxx');
    define('DB_DATABASE', 'myspace');

    // set
    define('HOMEPAGE','http://www.myfriendslayouts.com');
    define('SITENAME','Myspace Codes and Layouts');
    define('SHOWPIMP','ON'); //ON or OFF show left-top

    define('ROOT_DIR', realpath(dirname(__FILE__)));
    define('MP3FLASHLIST_DIR',ROOT_DIR."/uploads/playlist");


    $mysql_server = DB_SERVER;
    $mysql_user = DB_USER;
    $mysql_pass = DB_PASSWORD;
    $mysql_db = DB_DATABASE;

    $strDBServer = $mysql_server;
    $strDBUser = $mysql_user;
    $strDBPass = $mysql_pass;
    $strDBName = $mysql_db;
    $strPath = $site_url;

    $site_name = SITENAME;
    $site_url = HOMEPAGE;

    $strFPID = "105346649";
    $strFPName = "Sexy Me!!!!";
    $strFPAge = "21";
    $strFPQuote = "ADD ME!";
    $strFPImage = "http://myspace-578.vo.llnwd.net/01169/87/55/1169155578_m.gif";
    ?>

    What is the setting for: define('ROOT_DIR',
    or can it be left set as the default above.

    my root directory is /home/username/myfriendslayouts.com/

    It appears if I use the default setting above the paths to some of the graphics on the site are not correct>

    Many thank's in advance for any help on this issue
    netnuta
     
    netnuta, Sep 22, 2006 IP
  2. esoomllub

    esoomllub Well-Known Member

    Messages:
    279
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Are you talking about using the ROOT_DIR with the output HTML? If so, just make sure all of your img tag src attributes start with /

    If you are talking about using this in php... I prefer to use $_SERVER['DOCUMENT_ROOT'] to determine the root dir.

    Is that what you are looking for? Or is the filename in another sub-directory that you need to determine?
     
    esoomllub, Sep 22, 2006 IP
  3. netnuta

    netnuta Active Member

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Hi there the problem I have is when you visit:
    http://www.myfriendslayouts.com/viewimage/userpics/animations/animals_102.gif the image does not show.

    Also HTML Code for profile:
    <a href="viewimage/userpics/animations/animals_102.gif" title="MySpace Graphics @ Myspace Codes and Layouts"><img border=0 src="userpics/animations/animals_102.gif" /></a> <a href="" target="_blank"><img src="img/button.gif" style="position:absolute; left:0px; top: 0px;" border="0"></a>


    Code for Comment:
    <a href="viewimage/userpics/animations/animals_102.gif" title="MySpace Graphics @ Myspace Codes and Layouts"><img border=0 src="userpics/animations/animals_102.gif" /></a> <br><a href="" target="_blank">MySpace Codes </a>



    Link to Image (Direct Link):
    userpics/animations/animals_102.gif

    All the above generated codes are missing http://www.myfriendslayouts.com/

    I believe the problem must be with the config.php settings such as :

    define('ROOT_DIR', realpath(dirname(__FILE__)));

    as I stated in the previous thread, am not sure what goes in the above?

    Any help much appreciated!





    define('ROOT_DIR', realpath(dirname(__FILE__)));
     
    netnuta, Sep 22, 2006 IP
  4. esoomllub

    esoomllub Well-Known Member

    Messages:
    279
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #4
    The image shows fine if viewimage is removed. Meaning... this url works http://www.myfriendslayouts.com/userpics/animations/animals_102.gif

    I can't answer your entire question, as I am a little unsure how this is being used. Is this a link that you are wanting others to put on their site, is this image tag generated on a page of your site?

    With a little context, I think I can solve this (if someone else doesn't first).
     
    esoomllub, Sep 22, 2006 IP
  5. netnuta

    netnuta Active Member

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    I have installed this Myspace resource script on my server but as stated in earlier threads the images on most pages are not being displayed correctly.

    It seems as if the config file is not giving the correct info.

    The domain to this site is: http://www.myfriendslayouts.com

    When you view this page:
    http://www.myfriendslayouts.com/viewimage/userpics/animations/animals_102.gif

    The image: animals_102.gif does not display. Also the boxes diplaying the codes that myspace members can post into thier profiles are not correctly displayed.

    These boxes are:
    HTML Code for profile:
    Code for Comment:
    Link to Image (Direct Link):

    Thet are all missing the http://www.myspacelayouts.com/ in the tags!

    Here is a domain for site that is using the exact same script and all dispalys O.K. : http://www.profilesmash.com

    Here is the link to the same page on thier site:
    http://www.profilesmash.com/viewimage/userpics/animations/animals_102.gif

    I hope this throws a bit more light on the problem!

    regards
    netnuta
     
    netnuta, Sep 23, 2006 IP
  6. netnuta

    netnuta Active Member

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #6
    Edit of Post!:eek:


    I have installed this Myspace resource script on my server but as stated in earlier threads the images on most pages are not being displayed correctly.

    It seems as if the config file is not giving the correct info.

    The domain to this site is: http://www.myfriendslayouts.com

    When you view this page:
    http://www.myfriendslayouts.com/view...nimals_102.gif

    The image: animals_102.gif does not display. Also the boxes diplaying the codes that myspace members can post into thier profiles are not correctly displayed.

    These boxes are:
    HTML Code for profile:
    Code for Comment:
    Link to Image (Direct Link):

    Thet are all missing the http://www.myfriendslayouts.com/ in the tags!

    Here is a domain for site that is using the exact same script and all dispalys O.K. : http://www.profilesmash.com

    Here is the link to the same page on thier site:
    http://www.profilesmash.com/viewimag...nimals_102.gif

    I hope this throws a bit more light on the problem!

    regards
    netnuta
     
    netnuta, Sep 24, 2006 IP
  7. usmcpv

    usmcpv Peon

    Messages:
    283
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I am trying to install the same script on my server. I am getting errors on every page except the main page, such as "Warning: main(ROOT_DIR/include/db.php): failed to open stream: No such file or directory in...."

    Can someone familiar with this script please tell me how this is fixed? My website is 4profiles.net.
    I have never had a problem like this before with any other scripts. I tried editing the config.php file in many ways and I still get this error.
     
    usmcpv, Sep 24, 2006 IP
  8. dartin

    dartin Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I know this is an old thread but if there is anyone who has used this script with success, please could you help. I have the same problem as above and presume it is the config.php file.

    Thanks
     
    dartin, Apr 6, 2009 IP
  9. codealot

    codealot Banned

    Messages:
    544
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    wouldnt your username have public_html in it ?
     
    codealot, Apr 7, 2009 IP