How to make "install.php" functions?

Discussion in 'PHP' started by relatedr, Sep 29, 2008.

  1. #1
    Hello,

    I was trying to change a script I have.
    To install the script you have to manually change the
    database.php and the functions.php and send the
    mySQL manually to phpmyadmin.

    So could anyone tell me of a good tutorial or explain
    how this is done? I know this are just replacement
    comments but I don't know which one to use and
    I don't have a clue how to send in the mySQL auto.

    If someone could teach me this I can give him something
    for his trouble ;)

    regards,
     
    relatedr, Sep 29, 2008 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    What you could do is make a single config.php file make this writable and than code the install.php such that it writes the variables as per the instructiions entered in the install.php .. we cant give u the code as we donno how ur script works..
     
    Bohra, Sep 29, 2008 IP
  3. relatedr

    relatedr Well-Known Member

    Messages:
    448
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Hello and thanks for the quick reply ;)

    Okey, the config.php file is written like this:

    define( "DOMAIN", "http://www.domain.com" );
    Code (markup):
    So what the install file needs to do is change the domain:

    define( "DOMAIN", "[COLOR="Red"]http://www.domain.com[/COLOR]" );
    Code (markup):
    So how would I change the code so the domain would become a variable?
    and how would the command be in the install.php file?

    Thanks for your time and help,

    regards,
     
    relatedr, Sep 30, 2008 IP
  4. orokusaki

    orokusaki Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You posted the same thing twice in the code bits
     
    orokusaki, Sep 30, 2008 IP
  5. relatedr

    relatedr Well-Known Member

    Messages:
    448
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    138
    #5
    Hello Orokusaki,

    Yes I'm fully aware of that.
    In the second one I'm highlighting the text that needs to be changed.

    regards,
     
    relatedr, Sep 30, 2008 IP
  6. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    dont think this can be done because when you define something it becomes a Constant , and cannot be be change hence "Constant",

    and u can work out that a variable >> varies :)

    but im not 100% on that.
     
    cornetofreak, Sep 30, 2008 IP