Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. ^^^ And here's the syntax definition that shows that -
  2. If you get your date of birth into a YYYY-MM-DD format, the following will calculate a person's age in whole years - $today = date("Y-m-d"); $age = substr($today, 0, 4) - substr($dob, 0, 4) - (substr($today, 5,5) < substr($dob, 5,5)); // difference in years, subtract one if the birthday has not occurred yet in the current year
  3. Which root folder? A leading slash / on a file system path refers to the root of the current hard disk. If you mean your document_root folder, use - $_SERVER['DOCUMENT_ROOT']
  4. Or, if you change your delimiter, you can do this directly in a query - http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set
  5. Without any specific information on what it is that makes no sense to you, there's really no way of answering. Help forums can only directly help with specific questions, specific errors, or specific problems with code. Specific questions are things like - my log in system uses an ->is_logged_in() method to return the status of the current visitor but the IM system is directly testing a session variable in its code. I have posted, with a label telling you which is which, the relevant code from each showing what I am taking about. How can I adapt the IM code to use the ->is_logged_in() method? Specific errors are things like php parse errors, runtime errors, warnings, and notices, or sql query errors. I am getting the following error when I run my code. Here is the actual error message and the relevant code needed to reproduce the error. Specific problems are things like - when I submit my form, the form processing code does ___________. Here is the relevant code needed to reproduce the problem and what data values I have. I can however suggest that you need to define what it is you are attempting to do before you try to do it.
  6. What paypal class are you using? Either post a link to the Author's site or post the script. Your program logic is out of order. You have a bunch of logic before the if ($myPaypal->validateIpn()) { statement. All the logic that attempts to access any of the ipn data should be inside the conditional that has tested if the payment_status is 'Completed'. I'm going to guess that none of the $myPaypal->ipnData values exist until after you call $myPaypal->validateIpn().
  7. ^^^ If you have gotten different results between php/mysql for a specific hash function, it is likely that the value you were hashing was not what you thought it was.
  8. It's track_errors That's not what you have in your ini_set() statement.
  9. array_unique
  10. It would be impossible to keep a list of ALL the posts viewed or not-viewed (depending on if you are a optimist or a pessimist) for each member. This is done by keeping a 'bookmark' (imagine that you are reading a book where pages (posts) are constantly being added to the end of the book) of the highest post id where the member has previously viewed all the posts up to that point and displaying the 'new' icon for posts that are greater than that bookmarked post id that have not been viewed yet. You only need to keep a smaller database table of the 'viewed' posts that have an id greater than the bookmarked post id. As new posts are viewed, their id is added to the table and the 'new' icon is not displayed for them. I'll leave the logic of when you advance the bookmark and clear entries out of the smaller table up to you (I wish SMF had gotten it right in all situations.)
  11. The following is the DELETE query syntax definition, with the most commonly use parts in red - You need to use some error checking and error reporting logic on ALL the queries you execute in your code. You would have likely gotten an sql syntax error at the * character in your query. A DELETE query does not use a * in it.
  12. The syntax you have posted is that of the mysql DATE_TIME() function. You would use that in your SELECT query statement when you retrieve the data from your database table.
  13. RalphLeMouf, you need to define what you are going to do before you write any code to do it. Which is really why this thread has not been solved yet. Someone pointed out above that your code is putting the hashed passwords for newly created accounts in a column named Password and the hashed passwords for pre-existing accounts in a column named encrypted_passwords. Until you put all the hashed passwords into the correct column and use that column in your code that is checking if the entered password matches what is stored in the table, your code won't work. If ALL the hashed passwords, both for new members and the pre-existing members was in your encrypted_passwords column, then the previous single query I posted that would perform all your logic directly in the query would be - $query = "SELECT id FROM cysticUsers WHERE Email = '$email' AND encrypted_passwords = SHA1(CONCAT(salt,'$password')) AND Status = 'active' LIMIT 1"; All you would need to do is check how many rows the query matched and retrieve the id column if the query did match one row. Also, your originally posted code was using mysql_real_escape_string() on the $email and $password variables. I recommend that you put that code back in since you are putting the $email value from the form into the query and my suggested query is also putting $password into the query.
  14. Yes, it does. But that is why each salt value that is generated is being stored in the database table. This results in a different salt string for each different member and it means that if someone does get a hold of the database table, they must try to crack that member's password individually using the salt value that is specific to that member.
  15. You are storing the newly registered hashed passwords in a column named Password, however you UPDATED the pre-existing passwords and saved them into a column named encrypted_passwords What exactly does not work? Logging in with an account that pre-existed or a newly created one, because where you have the hashed passwords stored is currently different, based on what you have posted so far. ^^^^ This is why I suggested in my last post that you need to troubleshoot WHAT your code and data are actually doing.
  16. Do you have error_reporting set to E_ALL (or a -1) and display_errors set to ON so that all the php detected errors are being reported and displayed? That would help answer what is going on and if there are mis-matches between your variable/index names. Don't put any @ in front of your statements to suppress errors. That just hides the problems. Your code still won't work but you won't have any idea where to look to find the problem. Do you know for a fact that your query is being executed and it is not producing an error? For all we know, your login form isn't submitting values in $_POST['subSignIn'], $_POST['email'], and $_POST['password'] and the code is being completely skipped over. I recommend troubleshooting what your code and data are actually doing. What is the current code and is it the only code on the page or is it combined with the other operations?
  17. Since there is nothing as the textual part of the link, nothing is displayed/rendered in the browser (at least in FF.) You are selecting username in your query, but referencing user in your php code.
  18. You need to remove the @ from in front of your statements. If you were getting php errors on those statements, it meant they weren't working. Hiding the errors doesn't make them go a way. Your code still won't work, but with the @ in the code, you won't know which statement is causing all the follow-on errors.
  19. The query that was posted is valid mysql and should have worked as is.
  20. Should work - $query = "SELECT id FROM cysticUsers WHERE Email = '$email' AND Password = SHA1(CONCAT(salt,'$password')) AND Status = 'active' LIMIT 1";
  21. The following will (tested) send the field data to your check.php file and display the response that is sent back - $(document).ready(function(){ $("#username_input").keyup(function(){ txt=$("#username_input").val(); $.post("check.php",{username:txt},function(result){ $("#feedback").html(result); }); }); });
  22. I think you misunderstood what a public help forum is for. You post the code you are having a problem with and someone with an interest in helping with the problem will reply in the forum.
  23. Something at or up to line 43 in regcheck.php, probably the "You Are Registered And Can Now Login" is output that is being sent to the browser. You cannot send output before you send a html header(). You would need to determine what is sending that output and either eliminate it or rearrange the logic in the program so that you only send output if you are going to remain on the page (It doesn't make sense to send output to the browser if you are going to redirect to another page.)
  24. Define: duplicate id in the same field? An example of what data you have would help.
  25. Your query is being built wrongly or you are trying to execute the actual php statement as sql instead of the resulting sql query statement. Define: when I put this in? What and where exactly are you dong this at?
×
×
  • 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.