Jump to content

verdrm

Members
  • Posts

    152
  • Joined

  • Last visited

    Never

About verdrm

  • Birthday 01/01/1964

Contact Methods

  • AIM
    ronny1975
  • Website URL
    http://gsk.com

Profile Information

  • Gender
    Male
  • Location
    Texas

verdrm's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. What I mean is that I would like to insert each line into a MySQL database. The charges are separated by the '^' character. I would like to parse the file so that I can save each line into a variable. Ex: $date = "D03/04/10"; $amount = "T-20.28"; $payee = "PYOUR LOCAL SUPERMARKET"; How can I accomplish this?
  2. How can I parse this QIF file using PHP? I would like each line to be stored in a variable for each "set" of charges (delimiter is the record separator ^). Thanks! !Type:Bank D03/03/10 T-379.00 PCITY OF SPRINGFIELD ^ D03/04/10 T-20.28 PYOUR LOCAL SUPERMARKET ^ D03/03/10 T-421.35 PSPRINGFIELD WATER UTILITY ^
  3. I need to extract data from a CSV file and insert it into a MySQL database. I am able to extract the data, however I cannot figure out how to group it. Sample File: 01 ISBN Name of Book Price 02 ISBN Name of Book Price So far I have an array with the entire file (reading file with PHP): Array ([0] => 01 [1] => 12345678X [2] => Title [3] => 120.00 ...etc. How can I modify the array to create groups of four for each item? Each item is its own array?
  4. I am having trouble authenticating users with LDAP. I can authenticate users when I use "CN" or "givenName" but not when I use "samaccountname", which is the username. CN is just the first + last name. Does anyone know why only CN and not samaccountname works? $strUsername = "test"; $strPassword = "pass"; $dn = 'samaccountname=' . $strUsername . ',OU=Staff,DC=mydomain,DC=com'; $strDomain = "ldap://localhost/"; $bolAuth = false; // connect to ldap server $port = "389"; $objConn = ldap_connect($strDomain); if ($objConn) { if ( $strPassword != null ) { $bolAuth = ldap_bind($objConn, $dn, $strPassword); if ( $bolAuth ) { $search_id = ldap_search($objConn, "OU=Staff,DC=mydomain,DC=com", "(samaccountname=".$strUsername.")"); $entries = ldap_get_entries($objConn, $search_id); if ($entries["count"] == 1) { $first_name = $entries[0]["givenname"][0];; $last_name = $entries[0]["cn"][0]; } } } ldap_close($objConn); } if($bolAuth==false){ echo "fail"; return false; }
  5. I have an iFrame with a source location of www.google.com. If I browse to another page on Google.com, I can go to it, but cannot obtain the source of the page. Using JavaScript, I can only return the parent location, www.google.com Is there a way to return the current page URL of an iframe? Another idea is, using PHP, when the iframe makes a request to a new page, is there some way to return the request? Ex: if I browse to google.com/images, can PHP return that the server is trying to request that page?
  6. Would you provide a code example of how to do that?
  7. That didn't work. Another suggestion?
  8. I have two strings: $string = shell_exec('reg.bat '.$arg); //returns word\0word\0word $stringA = "$string"; $stringB = "word,other,word2,other2"; $array1 = explode('\0', $stringA); $array2 = explode(',', $stringB); $result = array_diff($array1, $array2); I can use array_diff to find the differences, but the last word in $array1 shows up as not in both strings even though it is because of the \0 delimiter. How can I include the last word as well?
  9. I need to extract "C:\Documents and Settings" from the last line of this data every time it appears. It is always between DirectoryName REG_SZ and HKEY. DirectoryName REG_SZ C:\Documents and Settings HKEY How can I extract "C:\Documents and Settings" or whatever the value is multiple times using PHP?
  10. I can read files from a network share, but can someone provide the code to create a file and folder on a network share?
  11. For anyone interested in reading a registry key: $shell= new COM('WScript.Shell'); $data=$shell->regRead('HKEY_LOCAL_MACHINE\PATH TO ENTRY');
  12. I found some code that can read Windows registry subkeys. The code works fine. define('HKEY_LOCAL_MACHINE', 0x80000002); $computer = '.'; $reg = new COM("winmgmts:{impersonationLevel=impersonate}!\\\\$computer\\root\\default:StdRegProv"); $key_path = 'SOFTWARE\NAV32\AntiVirus'; $sub_keys = new VARIANT(); $reg->EnumKey(HKEY_LOCAL_MACHINE, $key_path, $sub_keys); foreach($sub_keys as $sub_key){ echo "$sub_key\n"; } However, it only reads the subkeys and not a specific value under a subkey. How can I get a value instead of a subkey? Thanks!
  13. I managed to get it to work using code on the PHP manual page for the ini parser. Array ( [Version] => Array ( [signature] => $Windows NT$ [Class] => ActivityMonitor [ClassGuid] => {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2} [Provider] => %Symc% [DriverVer] => 06/24/2009,12.8.0.10 [CatalogFile] => SymEvent.cat ) The only issue now is how do I extract DriverVer?
  14. I'm getting this error using your snippet of code: Warning: parse error, expecting `TC_DOLLAR_CURLY' or `TC_QUOTED_STRING' or `'\"''
×
×
  • 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.