undefined function (php)


Results 1 to 3 of 3

Thread: undefined function (php)

  1. #1
    Join Date
    Aug 2002
    Posts
    476

    undefined function (php)

    Hi guys.

    I'm creating a loginform, with an included DBconnector file that reads in it's parameters from an .ini file. I get the following error:

    Fatal error: Call to undefined function: parse_ini_string() in /home/arioch/public_html/dbconnector.php on line 2

    I have "php4-mysql" installed so that ain't it.

    PHP Code:
    <?php
    $dbvalues 
    parse_ini_string('dbusers.ini') or die("Could not read config file");
    $_SESSION();
    If (
    $_SESSION['user'] == 1) {
    $SQL $dbconnector = @mysql_connect($dbvalues['hostname'],$dbvalues['databaseroot'],$dbvalues['databaserootpassword']) OR die('<h3 class="warning">Failure: Failed connecting to the database. Verify that the parameters you gave are correct, and that the database is running and accessible.</h3>');
    }
    else {
    $SQL $dbconnector = @mysql_connect($dbvalues['hostname'],$dbvalues['customer'],$dbvalues['customerpassword']) OR die('<h3 class="warning">Failure: Failed connecting to the database. Verify that the parameters you gave are correct, and that the database is running and accessible.</h3>');
    }
    $dbselector = @mysql_select_db($dbvalues['databasename']) OR die('<h3 class="warning">Failure: Failed selecting your database. Verify that the parameter you gave is correct, and that the database is running and accessible.</h3>');
    ?>
    What am I missing?
    Last edited by arioch; 06-20-2007 at 05:51 PM.

  2. #2
    Join Date
    Sep 2002
    Location
    South Jersey Shore
    Posts
    293
    I think what you might be looking for is "parse_ini_file()"? "parse_ini_string" doesn't seem to appear in any of the PHP documentation.

  3. #3
    Join Date
    Sep 2005
    Posts
    681
    parse_ini_string('dbusers.ini')
    is that a function i would check php.net to find out... i have never see that before. what is your script trying to do?? you run mysql i can see that.... to connect to mysql use php function

    mysql_connect read the php manual about it
    "Software is like sex: it's better when its free."
    -LINUS TORVALDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •