Jump to content

Spleshmen

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by Spleshmen

  1. something like this? <?php $a = array( 'group 1' => array( 0 => 'item g1 0', 1 => 'item g1 1', 2 => 'item g1 3' ), 'group 2' => array( 0 => 'item g2 0', 1 => 'item g2 1', 2 => 'item g2 2' ) ); echo '<pre>'; print_r($a); echo '</pre>'; ?> result Array ( [group 1] => Array ( [0] => item g1 0 [1] => item g1 1 [2] => item g1 3 ) [group 2] => Array ( [0] => item g2 0 [1] => item g2 1 [2] => item g2 2 ) )
  2. $count = 0; $query = ("SELECT * FROM tutor_preferred_district ORDER BY district_id ASC"); $sql = mysqli_query($dbc, $query) or die(mysql_error()); while($data = mysqli_fetch_array($sql)) { [$count++; echo'<table>'; echo '<input name="district" type="checkbox" id="'.$data['district_id'].'" value="'.$data['district_id'].'">'; echo '<label for="'.$data['district_id'].'">'.$data['district_name'].'</label>'; echo'<table>'; if ($count==3) { echo '<br>'; $count=0; } }
  3. First i want to say hello all,second i need your help i am trying to connect to a ldaps server from another server. i got all the information i need to connect to the ldaps server (host,port,password,bind_rdn - second parameter from ldap_bind,base_dn - second parameter from ldap_search) and 2 certificates the SSL CA and Root CA generated from the ldaps server. i never used the data from the certificates on the server i am trying to make the connection with the ldaps server.could that be the reason why i cant establish a connection? here is my code : $config = array( 'host' => 'ldaps://***.com', 'port' => some int 'bind' => 'uid=*,dc=**,dc=**,dc=**', 'pass' => '**', 'dbase' => 'dc=**,dc=**,dc=**' ); $c = ldap_connect($config['host'],$config['port']); if ($c==FALSE) { echo 'Error ldap_connect'; } else { $action = ldap_bind($c,$config['bind'],$config['pass']); if ($action==FALSE) { echo 'LDAP bind fail <br/> '; echo 'ldap_error : <b>'.ldap_error($c).'</b> <br/>'; else { echo 'LDAP bind true'; } } the error i am getting is Can't contact LDAP server thats about it ... thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.