Jump to content

jargen

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by jargen

  1. Thanks for all the help mate, just re-coded it to PBO.
  2. My concern is simply the fact, that a new security feature will come out, or something which you are advised to add. Like when mysqli was added and preparing statements (Compared to just using escape string before). I could have potentially hundreds of queries to lock down instead of one. What do you suggest in regards to that?
  3. Hey guys Slightly lost on how to do this one. Im trying to make a function which will insert data into a MySQL table. But im trying to make it universal, so i can use the same function for any part of the application, so theres only one mysql query i need to secure, rather then hundreds across the entire site. I know how i can make it go to the right table and such, my problem is how do i make it add the array of values to insert, when i have no idea how long it will be? Struggling to find a clear method online
  4. Dosent help work out how to get the Process ID and stop it.
  5. I need a way to start a program and store the PID, then manage to stop it at the users request later. Im not sure how i would go about this. It has to work on Windows, Any help? Thanks.
  6. The test code is $password = generatepassword(); $passwordsafe = encryptdata($password,"dddsgsdfnhjkdgh"); $test = decryptdata($passwordsafe, "dddsgsdfnhjkdgh"); print($password." ".$passwordsafe." ".$test); So i dont understand what is happening
  7. Hi, Im using this code: function encryptdata($data_input,$key){ $td = mcrypt_module_open('cast-256', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $encrypted_data = mcrypt_generic($td, $data_input); mcrypt_generic_deinit($td); mcrypt_module_close($td); $encoded_64=base64_encode($encrypted_data); return $encoded_64; } function decryptdata($encoded_64,$key){ $decoded_64=base64_decode($encoded_64); $td = mcrypt_module_open('cast-256', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $decrypted_data = mdecrypt_generic($td, $decoded_64); mcrypt_generic_deinit($td); mcrypt_module_close($td); return $decrypted_data; } To try to encrypt and decrypt some data, However the decrypted password has the first 2 letters missing. Whatever length string i put in its always the first 2 letters that go missing. I have tried multiple pieces of code over the internet with the exact same problem. Example: (Original Password, Encrypted Password, Decrypted Password) BEBw3nJ9rT y3CdmtNeTmhO3Jrq/00YOA== Bw3nJ9rT Any help? Thanks. P.s Yes i am using the same key for the encryption and decryption.
  8. My code is: SELECT * FROM wp_newsoptions WHERE option='often' I am running it via the sql query in phpmyadmin.
  9. All i get is a syntax error. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option="often" LIMIT 0, 30' at line 1
  10. Whenever i try this code i get a syntax error. Any help? SELECT * FROM wp_newsoptions WHERE option='often'
  11. Aha sorted it. Needed to change the permissions on the root dir
  12. what permissions would it need? ive made it have 777
  13. I dont need to create the /whatever folder the script does that automaticly. I just cant make it do it in the correct place
  14. it just makes the folder in the directory the file is in.
  15. Hi, I have got a ftp script. which backs up all the folders into a directory. That works fine but when i try to set the directory to behind the web root it dosent work. I need it to back it up into /whatever the file is in /var/www so i tried this "../../whatever" but it didnt work. if i set it to "whatever" it works fine (but the folder is in /var/www (/var/www/whatever)) when i need it in /whatever. Any help. Thanks
  16. jargen

    FTP help

    that script dosent seem to work. It only works with local directory's not ftp
  17. jargen

    FTP help

    yeah. But how do i make it keep adding all the directorys that it finds and checking them? I cant get my head around the theory of it
  18. jargen

    FTP help

    I know how to get a file. But my problem is im not sure how to change my code to make it get a list of all the directory's, subdirectorys,sub-subdirectory etc and all the files within them
  19. Hi, I have this script <code> <?php //login to ftp change details via database $list = ftp_nlist($resource, \"/public_html/\"); //unwanted files $unwanted=array(); $unwanted[1]=\".\"; $unwanted[2]=\"..\"; $unwanted[3]=\".htaccess\"; $unwanted[4]=\"cgi\"; $unwanted[5]=\"cgi-bin\"; $unwanted[6]=\"error_log\"; //insert files/folders not to backup via database //end //remove unwanted files and directorys-Needs to be ran for every directory $i=0; foreach($list as $array){ foreach($unwanted as $array2){ if($array2==$array){ unset($list[$i]); } } $i++; } //end //gets list of files and directorys in root $i=0; foreach($list as $array3){ $files[$i]=explode(\".\",$array3); $i++; } $i=0; $file=array(); $directory=array(); while($i != count($files)){ if( count($files[$i]) == 2){ $file[$i]=$files[$i][0].\".\".$files[$i][1]; }else{ $directory[$i]=$files[$i][0]; } $i++; } print_r ($file); print_r ($directory); //end ?> </code> which works fine. But im completly stuck on how to make it get the files from all the directorys and all the directorys in them. So in the end i can download them all. Any ideas? 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.