SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Member esammons's Avatar
    Join Date
    Sep 2004
    Location
    Virginia
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Warning: pg_errormessage()...pgsql.php

    I have developed some code that uses PHP 4.3.2 and PEAR::DB. An interesting event upon executing the code. I get a blank page; however, if I refresh the page the expected page displays. In my error_log file I recieve the following message:

    Directory index forbidden by rule: /var/www/html/
    PHP Warning: pg_errormessage(): supplied argument is not a valid PostgreSQL link resource in /usr/share/pear/DB/pgsql.php on line 410
    PHP Fatal error: Call to undefined function: fetchinto() in /var/www/html/syslog/login.php on line 50

    The code around line 50 in login.php appears below:

    Code:
        46           if(isset($entries)) {
         47              foreach($entries[0]['memberof'] as $groups) {
         48                 $sth = $dbh->query("SELECT operation from access where groupname = '".$        groups."'");
         49 
         50                 while($sth->fetchInto($row,DB_FETCHMODE_ASSOC)) {
         51                    if($row['operation'] == $myUrl) {
         52                       $_SESSION['authok'] = 1;
         53                       $dbh->disconnect();
         54                       break;
         55                    } else {
         56                       $_SESSION['authok'] = "";
         57                       $welmsg = "You Are Not Authorized to View This Page";
         58                    }
         59 
         60                 }
         61              }
         62           }
    My connect.php follows below...

    Code:
    <?php
     
       require 'DB.php';
            function MyDbConnect() {
                    $dsn = array(
          'phptype'      => 'pgsql',
          'username'     => 'user',
          'password'     => '',
          'hostspec'     => 'localhost',
          'port'         => '5432',
          'database'     => 'DATABASE',
          );
    
       $options = array(
          'debug'           => 2,
    //      'portability'     => DB_PORTABILITY_ALL,
          );
    
       $db =& DB::connect($dsn, $options);
    
            return $db;
            }
    ?>
    Has anyone seen this problem before and if so is there a way to address the issue?

    Thanks!
    Last edited by esammons; Nov 22, 2004 at 07:08. Reason: Smiley in the post....


Bookmarks

Posting Permissions

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