Jump to content

grenouille

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

grenouille's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yep, that did the trick. thnx a lot! grenouille
  2. Hi, I wrote some code to retrieve data from a textfile. The code inserts data into a multidimensional array retrieved from the textfile. When printing out the array contents, it shows exactly what it's supposed to, so I know the code in itself is OK. This is the code : [code]             $filename = "db.txt"; $handle = fopen($filename, "r"); $content = fread($handle, filesize($filename)); fclose($handle); $bulk = get_string_between($content, "<sections>", "<sections>"); $global_array = explode(" || ", $bulk); for($i=0; $i<count($global_array); $i++) { print $global_array[$i]."<br>"; $int_array = explode(" | ", $global_array[$i]); $sect_arr[$i][0] = $int_array[0]; $sect_arr[$i][1] = $int_array[1]; } [/code] When I print out the contents of $sect_arr everything goes well. However, when I put this code in a function and call that function, it doesn't show anything. This is the function : [code] function CreateSectionArray($sect_arr) { $filename = "db.txt"; $handle = fopen($filename, "r"); $content = fread($handle, filesize($filename)); fclose($handle); $bulk = get_string_between($content, "<sections>", "<sections>"); $global_array = explode(" || ", $bulk); for($i=0; $i<count($global_array); $i++) { print $global_array[$i]."<br>"; $int_array = explode(" | ", $global_array[$i]); $sect_arr[$i][0] = $int_array[0]; $sect_arr[$i][1] = $int_array[1]; } } [/code] ... and this is how the function is called : [code] CreateSectionArray($sections); [/code] When I print out this array $sections with print_r it seems to be empty. I suppose it's something very basic, but I just can't find it. Your help would be very much appreciated. Thnx in advance, Grenouille
  3. Hi there, On our website we use a (Java) filemanager, which customers can use to upload their files. This filemanager does not have something like 'notify for new files'. So we need a php script to watch the folders and all subfolders for new files and to notify the responsible operator. I know we can create a cronjob for this script. Does anybody know of such a (free) script? Thnx, Grenouille
  4. i found a solution myself. i thought i should post it. it is not actually a solution. i just put an @ before the list and fsockopen functions so the errors are no longer shown. [code] function checkEmail($email) {   if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))   {       return FALSE;   }     @list($Username, $Domain) = split("@",$email);   if(getmxrr($Domain, $MXHost))   {       return TRUE;   }   else   {       if(@fsockopen($Domain, 25, $errno, $errstr, 30))       {         return TRUE;       }       else       {         return FALSE;       }   } } [/code]
  5. hi, i found a php-function on the internet to validate an email address, but i'm getting some errors. see the code and the errors below. anyone any idea with might be going wrong? the function seems to work, but it produces errors in some way. thnx in advance, grenouille [quote] Notice: Undefined offset: 1 in ... on line 12 Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in ... on line 20 Warning: fsockopen(): unable to connect to :25 ... on line 20 [/quote] [code] function checkEmail($email) {   if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))   {       return FALSE;   }     list($Username, $Domain) = split("@",$email);   if(getmxrr($Domain, $MXHost))   {       return TRUE;   }   else   {       if(fsockopen($Domain, 25, $errno, $errstr, 30))       {         return TRUE;       }       else       {         return FALSE;       }   } } [/code]
  6. okay thnx. i'll upgrade first, then i'll annoy you again with my questions :)
  7. php version is 4.2.2 could this be the cause of raw output failure?
  8. hm, now i get the following error [quote] Warning: Wrong parameter count for md5() in ... [/quote]
  9. okay, my explanation was a bit confusing but that is exactly what i did. [code] <? $str = 19721972; $str = md5($str); $str = base64_encode($str); echo $str; ?> [/code]
  10. hi, i am using an open source (java) filemanager on one of my websites. user data is stored in an xml-file. when a visitor uses the filemanager itself to register, the password is first md5 encrypted and after that base64 encoded (according to the developer). now i want to write my own register-form for this filemanager. so i take the password value, md5() and base64_encode() it, but it gives NOT the saĆ¹me result as when the filemanager itself encrypts. f.i password= 19721972  ==> filemanager result = NREVYMjLF45+vX9VM9KAxg== but : $password=19721972, md5($password) ==> 35111560c8cb178e7ebd7f5533d280c6   and then base64_encode($password) ==> MzUxMTE1NjBjOGNiMTc4ZTdlYmQ3ZjU1MzNkMjgwYzY= anyone any idea what may cause this difference? the developer told me he used the Java MessageDigest class to md5 encrypt. If you know the answer, please do not get to technical (if possible)  :) thnx in advance.
×
×
  • 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.