Jump to content

phyang

New Members
  • Posts

    6
  • Joined

  • Last visited

phyang's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi admin, i'm trying to implement a VNC web browser using PHP/Javascript, application below are what i looked at so far. 1. No VNC --> i think this method have more proxy security on enabling this, security on this one is harder to bypass 2. Guacamole --> i dont see any extension file for this to be run along XAMPP(apache) I dont see how Guacamole can be install along XAMPP, or is it even possible to install along with it? this is for Windows. Is there other alternative on how to enable this web browser VNC feature using PHP/Javascript. Please advise. thankyou all admin for past hints/tips support on my LDAP enabling and features !
  2. thankyou kind sir!! it work! but now also have another problem :(, where the there is space highlighted in yellow in picture below? so do i need to fix this also in the LIST? or the main UL Class? <span style="margin-left: 42px; padding:9px"> Selected System Configs: </span> <div class="dropdown " style="margin-left: 42px; padding:9px"> <button class="btn btn-primary dropdown-toggle" style="margin-left: 48px" id="buttonselect" type="button" data-toggle="dropdown">None Selected <span class="caret"></span></button> <ul class="dropdown-menu"> while($rows = mysqli_fetch_assoc($result)){ global $myout; if($lastname == ''){ echo "</a>"; echo "</li>"; echo "<li style='border: 2px solid blue;' class='dropdown-submenu' ><a class='test2' href='#' onclick='getCategory(\"" . $rows['name'] . "\")'>" . $rows['name']; $lastname = $rows['name']; } else { if($lastname == $rows['name']){ if($dropdownlevel ==1){ echo "<span class='caret'><a class='test' href='#'>&nbsp;&nbsp;&nbsp; -->(more)</a></span></a>"; echo "<ul class='dropdown-menu dropreset'>"; echo "<li style='border: 2px solid blue;'><a tabindex='-1' href='#' style='padding: 60px' onclick='getCategory(\"" . $rows['name']."\",\"".$rows['Sku']."\")'>".$rows['Sku']."</a></li>"; $dropdownlevel =2; } else { echo "<li style='border: 2px solid blue;'><a tabindex='-1' href='#' style='padding: 60px' onclick='getCategory(\"" . $rows['name']."\",\"".$rows['Sku']."\")'>".$rows['Sku']."</a></li>"; }
  3. hi my PHP community :D. I have a drop down menu but it look weird? it's a plain box with my drop down items from Db(picture down is dummy), it doesn't show any stripe/line that separate them? I'm not too good at HTML and have copy the below lines from some one else drop down sample code and modify to my liking. Anything i can do to change the line below so I can see stripe lines or anything that can make this look nicer? issue : echo "<li class='dropdown-submenu' ><a class='test2' href='#' onclick='getCategory(\"" . $rows['name'] . "\")'>" . $rows['name']; while($rows = mysqli_fetch_assoc($result)){ global $myout; if($lastname == ''){ echo "<li class='dropdown-submenu' ><a class='test2' href='#' onclick='getCategory(\"" . $rows['name'] . "\")'>" . $rows['name']; //printing Db List $lastname = $rows['name']; } else { if($lastname == $rows['name']){ if($dropdownlevel ==1){ echo "<span class='caret'><a class='test' href='#'>&nbsp;&nbsp;&nbsp; -->(more)</a></span></a>"; //display arrow to next level echo "<ul class='dropdown-menu dropreset'>"; echo "<li><a tabindex='-1' href='#' style='padding: 60px' onclick='getCategory(\"" . $rows['name']."\",\"".$rows['Sku']."\")'>".$rows['Sku']."</a></li>"; $dropdownlevel =2; } else { echo "<li><a tabindex='-1' href='#' style='padding: 60px' onclick='getCategory(\"" . $rows['name']."\",\"".$rows['Sku']."\")'>".$rows['Sku']."</a></li>"; //display Level 2 Option
  4. i figured out the issue....it was the server that i was connecting too...it was returning blank; connecting to an known good server solve my issue :), thanks all.
  5. hello php community :), i'm scripting this to talk to my company LDAP server, i'm able to bind the connection successully, but then it does not dump anything out? can you please advise on the scripting if i'm missing anything? port? I remove the password, username, and ldap connection and so as the ldap_dn since it's personal. but please advise me on what i'm missing? example how i connect: I can only connect to server with this: ldap_connect('google.com'); i cannot connect if i reference port as this? should i even reference port at all? ldap_connect('google.com',3269); or this ldap_connect('ldaps://google.com:3269'); <?php $ldap_password = ''; //enter your ldap password here $ldap_username = ''; //enter your ldap username here $ldap_connection = ldap_connect(''); //enter your ldap server here if (false === $ldap_connection) { // Uh-oh, something is wrong... print "CONNECT ERROR<br />"; } /** * Get a list of users from Active Directory. */ print "Connect Success...<br />"; // We have to set this option for the version of Active Directory we are using. ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3) or die('Unable to set LDAP protocol version'); ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, 0); // We need this for doing an LDAP search. if (true === ldap_bind($ldap_connection, $ldap_username, $ldap_password)) { print "Bind Success...<br />"; $ldap_base_dn = 'DC=?,DC=?,DC=com'; //enter your base_dn here in this case we enter this for our example $search_filter = '(&(objectCategory=person)(samaccountname=*))'; $attributes = array(); $attributes[] = 'givenname'; $attributes[] = 'mail'; $attributes[] = 'samaccountname'; $attributes[] = 'sn'; $result = ldap_search($ldap_connection, $ldap_base_dn, $search_filter, $attributes); print "ldap_search error: ".ldap_error($ldap_connection) . '<br />'; ldap_get_option($ldap_connection, LDAP_OPT_DIAGNOSTIC_MESSAGE, $err); echo "ldap_get_option: $err"; if (false !== $result) { print "LDAP Search...<br />"; $entries = ldap_get_entries($ldap_connection, $result); for ($x=0; $x<$entries['count']; $x++) { if (!empty($entries[$x]['givenname'][0]) && !empty($entries[$x]['mail'][0]) && !empty($entries[$x]['samaccountname'][0]) && !empty($entries[$x]['sn'][0]) && // 'Shop' !== $entries[$x]['sn'][0] && 'Account' !== $entries[$x]['sn'][0]) { $ad_users[strtoupper(trim($entries[$x]['samaccountname'][0]))] = array('email' => strtolower(trim($entries[$x]['mail'][0])),'first_name' => trim($entries[$x]['givenname'][0]),'last_name' => trim($entries[$x]['sn'][0])); } } } ldap_unbind($ldap_connection); // Clean up after ourselves. } $message .= "Retrieved ". count($ad_users) ." Active Directory users\n"; // add receiving data to as ad_users print $message; echo '<pre>'; print_r($entries); echo '</pre>'; ?>
×
×
  • 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.