Jump to content

trink

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

trink's Achievements

Member

Member (2/5)

0

Reputation

  1. Well to do it on the page itself, you're looking more at JavaScript/JQuery. If you want to do it after the submit, I'd suggest something like this: if($_POST['box1'] === $_POST['box2'] || $_POST['box1'] === $_POST['box3'] || $_POST['box2'] === $_POST['box3']){ die('You cannot make the same selection twice'); }
  2. Assuming SHA1 is secure on its own is very very bad practice, let alone an all-around horrible idea, and that goes with any hash function. First off, SHA1 has already been broken, collisions can be made, there are also rainbow tables out there. Not only this, but I would always suggest making the string to be hashed larger than the resulting digest. Since you know the size of the resulting digest (SHA1 is 140-bit) I'd suggest creating some sort of salt in there, some key to strengthen the resulting digest. $key = 'jfioepafipo4jeigphaue4gfASE$*(GTA)($GFAUEW$I)GFAHEPGdrjsiv;arshvuialnuiafhuaiewpguzdjlgvd;'; //random 632-bit string because I'm paranoid $hash = sha1($key.$input); To compare just use the same key.
  3. Passwords are only encrypted via SHA1, or is there something else in there to strengthen the digests?
  4. I definitely just noticed my error there, it would be file_put_contents, my bad. Ok try this <?php $newfile = 'result.txt'; $files = glob('C:\path\to\files\*.txt'); foreach($files as $file) file_put_contents($newfile, file_get_contents($file) . "\n", FILE_APPEND); ?> EDIT: Just noticed that AbraCadaver posted essentially the same code, and his would be better than mine, seeing as how his incurs only one filewrite, and mine incurs multiple. The more you know.
  5. $strSQL = "SELECT * FROM EmployeeInfo, Absence ORDER BY Name WHERE Name='NameSelect'"; should be $strSQL = "SELECT * FROM EmployeeInfo, Absence ORDER BY Name WHERE Name='{$_POST['NameSelect']}'"; And your last query still has nothing that will tell it which account to access, it's just telling it this: Select the absence date from the tables where the account is equal in both tables, so it'll select essentially everything that has matching rows in each table. Try something like this $result = mysql_query("SELECT AbsDate FROM EmployeeInfo, Absence WHERE Absence.Account = EmployeeInfo.Account AND Absence.Account = (SELECT Account FROM EmployeeInfo WHERE Name = '{$_POST['NameSelect']}')";
  6. Look up the glob() function, that might be what you're looking for.
  7. <?php $x = array( file_get_contents('file1'), file_get_contents('file2'), file_get_contents('file3') ); file_write_contents('final_file', implode("\n", $x)); ?> That should do the trick.
  8. That select would have to have a name, IE <select name="blah"> Then on the page that it posts to, just use $_POST['blah'] to get the value of the selected option.
  9. I'm working with PHP on a Windows 2k3 server, and I have a script that is called via AJAX that has to run a shell_exec() command. I've given Read and Execute permissions for the IUSR_ and IWAM_ accounts on cmd.exe, but nothing has come of it. The problem is that when I call shell_exec(), exec(), system(), or any command that performs an execution of a program, it hangs. If I deny permissions to IUSR_ and IWAM_ then it returns an empty string and exits. I've tried it on exec() as well and the script will finish up as expected, but will not execute the command that I'd like it to execute. We are currently using PHP 5.2.4. Would an upgrade to 5.2.9 fix this? Could this be a problem with coding? Could it be a problem with Windows? Or is this a much larger monster than I first thought? Any help would be greatly appreciated.
  10. Change the content-type in the header to a fake one that would normally prompt the user.
  11. I originally said natsort() without thinking, it would be ksort(), my bad.
  12. I'm trying to create a friends list type deal, and I'd like to know if there is any possible way of checking whether a user is online or not. Each user has an active session which contains their privileges and whatnot. Is there any way that when the user closes the window and the session eventually ends that it could perform a mysql query?
  13. I got all that, and so I thought the problem was something a bit different, but it turns out it was the host's problem with the ftp. Thanks
  14. Sounds good. How would I do that? 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.