Jump to content

cjburkey01

Members
  • Posts

    17
  • Joined

  • Last visited

cjburkey01's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. I have just discovered my error. It was extreme stupidity: $sql -> bindParam(":password", password_hash($email, PASSWORD_DEFAULT)); should be $sql -> bindParam(":password", password_hash($password, PASSWORD_DEFAULT)); in the register form. *sigh* Yup
  2. So, basically, I have a simple database where users are stored. password_hash is used to insert the passwords, but for some reason, this code: $sql = $conn -> prepare("SELECT `password` FROM `users` WHERE `email`=:email LIMIT 1"); $sql -> bindParam(":email", $email); $sql -> execute(); $out = $sql -> fetch(); print_r(password_verify($password, trim($out['password'])) . " - " . $password . " - " . $out[0]); die(); displays this: - spice - $2y$10$YOVX2MCk8KSpUuii5fEQ5.OUmRh09lEfF.wZ65jh4.PUB5wSgdHim Even if I was using the wrong password, shouldn't it at least return false? Is this some part of a new feature in PHP 7?
  3. I'll bump then. BUMP BUMP BUMP BUMP BUMP BUMP BUMP
  4. Um, when I use this file, it works for everything, but if the file is nested once in a directory, it does not put that directory in the file list. So, you could have a file like this: config/cofh/core.cfg But it only shows as this: core.cfg But if it is further, it work: /config/cofh/core/file/thing.cfg would list like core/file/thing/core.cfg I use this code: <?php function drawArray(DirectoryIterator $directory, $file ){ $path = ''; foreach ( $directory as $object ){ if ($object->isDir() && !$object->isDot()){ $path .= $object->getFilename() .'/'; $result[$object->getFilename()] = drawArray( new DirectoryIterator( $object->getPathname() ), $file ); }else if($object->isFile() && $object != '.DS_Store'){ $line = $path . $object->getFilename()."\n"; file_put_contents($file,$line,FILE_APPEND); } } } drawArray( new DirectoryIterator( 'mods' ), 'mods.txt' ); drawArray( new DirectoryIterator( 'config' ), 'config.txt' ); ?>
  5. So, I wouldn't need the delete function. Right?
  6. It's a one time thing, well, unless I update the file list. I'm using a java program that reads the mods.txt, gets the url, and dwnloads each file(More proof-of-concept than functional )so, I wanted to run that php everytime I add a new file, (And I didn't want to list the files on my own)
  7. Yes, I now see that problem, so would be more efficient to create the file, convert, insert, delete, then close, instead of reopening and everything?
  8. Hello people! I have this bit of code: <?php function drawArray(DirectoryIterator $directory) { $result=array(); foreach($directory as $object) { if($object->isDir()&&!$object->isDot()) { $result[$object->getFilename()]=drawArray(new DirectoryIterator($object->getPathname())); } else if($object->isFile()) { $result[]=$object->getFilename(); } } return $result; } $array=drawArray(new DirectoryIterator('mods')); $info = implode("\n",$array); file_put_contents("mods.txt", $info); $array2 = drawArray(new DirectoryIterator('config')); $info2 = implode("\n",$array2); file_put_contents("config.txt", $info2); function remove($Filename, $key) { $fc=file($Filename); $f=fopen($Filename,"w"); foreach($fc as $line) { if (!strstr($line,$key)) fputs($f,$line); } fclose($f); } remove("mods.txt", "Array"); remove("mods.txt", ".DS_Store"); remove("config.txt", "Array"); remove("config.txt", ".DS_Store"); ?> It works, but I have directories in the folder it's searching, how would I make it print the directories to the file in this formate: directory/fileInIt.cfg?
  9. IT WORKS!!! THANK YOU ALL FOR THE HELP
  10. $eng = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' ,'l' ,'m', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); $udc = array('u', 'd', 'c', 'b', 'o', 'h', 'g', 'f', 'i', 'n', 'm', 'l', 'k', 'j', 'e', 't', 's', 'r', 'q', 'p', 'a', 'z', 'y', 'x', 'w', 'v'); $convertedLanguage = strtr($_POST['box'], array_combine($eng, $udc)); Should work?
  11. OK, so like $eng = array('/a/i', '/b/i', '/c/i', '/d/i', '/e/i', '/f/i', '/g/i', '/h/i', '/i/i', '/j/i', '/k/i' ,'/l/i' ,'/m/i', '/n/i', '/o/i', '/p/i', '/q/i', '/r/i', '/s/i', '/t/i', '/u/i', '/v/i', '/w/i', '/x/i', '/y/i', '/z/i');
×
×
  • 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.