Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. This just proves my supposition. You are storing the pw in a hashed state. Good. But when you try to do a login, you go looking in the db for an un-hashed password. That fails (0 rows) and you send back the not found message. You enter the credentials again and the whole query and error msg process repeats, just like you said in your OP.
  2. Yes it is but you have no matching record that I can see since you did a query looking for the unhashed password value which doesn't exist, no? If you query looking for the true typed-in username (which you should be sanitizing before putting into a query btw) and the true typed-in password (which needs to be sanitized and hashed) you won't find it. So it makes no sense to be doing a compare after that since there is nothing to compare.
  3. You hash it and supply THAT value to the query.
  4. The message is quite direct. It's telling you that the php install/config you are using does not allow includes (requires) specifying a url. You can only include files that are part your your filesystem, not from the web. If this module is truly something within your filesystem, then point to it that way, not as a url.
  5. you are hashing your password to compare to the query results, no? But your query was looking for a match to an unhashed password entry. How is that ever going to work? You really should be attached to your code. Plus - why did you make this simple little login process into 4 separate modules? A bit complicated, no?
  6. how do you know it failed? Do you get a message - no because you didn't check your query results and issue one.
  7. Do these bits of code have names?
  8. Happy that you have solved this problem. Something you should consider in future efforts. The following line: asdf $result = mysqli_query($con,$sql); holds the results of your query. IF it ran successfully. When it doesn't it contains 'false' - which you should always test for in order to be sure that you actually have results to play with. Simply add: $result = mysqli_query($con,$sql); if (!$result) { echo "Query did not run - error is ---"; ( here you should show an error message from mysqli and decide what you want to do from this point on.) }
  9. How do you know you don't have an error? Do you have php errors enabled? You aren't checking that the result of your query is valid either. You exit without showing any of your results, not even an acknowledgement that it MAY have worked. With that said - your query is bad.
  10. FPDF is a php class. That means you write your same old php code to accomplish your solution (get the data!) but when it is time to output it you make calls to methods of this class instead of echo'ing it to the client. It will take a little practice to understand how the calls work and to get comfortable with the setting of x & y coordinates but if you're a programmer you'll catch on soon.
  11. Like trq said - we need some direction so that we can give you direction. Please explain your problem better. Your original post was kind of squirrely. Can you write better English or at least elaborate more on your problem(s) with fpdf? I've used fpdf multiple times and think I know it pretty well.
  12. Which is why I wanted to see your code. good luck - hth
  13. No - all your code. Plus add a check of the number of rows you get from the query before continuing.
  14. Why won't you use the line I gave you? Yours is flawed. Please?
  15. my string works and is much simpler: $q = "select * FROM data WHERE DATE_FORMAT(date_time, '%Y-%m-%d') = '$todaysdata' "; Note: I changed the quotes as well as the month spec - %m will give you 01,02... as it should be. Note that by using dbl quotes outside you can avoid having to concatenate the variable at the end.
  16. Change my double quotes around the format string to singles.
  17. 1 - why are you using sprint??????? 2 - you're thinking backwards. You want to get the table's date field in a format that you can compare your $todaysdata field to, no? If you applied your curiosity and work effort to a little research on MySQL you would find the list of MySQL functions that are available. Especially the ones that pertain to dates. $q = "select * FROM data WHERE DATE_FORMAT(date_time, "%Y-%c-%d") = '$todaysdata' ";
  18. That's because you have no data. Agreed? Think about what you wrote in your first post. You know what the date_time (btw - bad field name) field holds in the table. You know what the value you wish to compare to the records looks like. Do they look alike?
  19. When you say "isn't working", whatever do you mean? I'm guessing that you get no results from your query. Yes?
  20. 1 - you are only saving the cookie for one hour. 2 - Does your browser have cookies disabled? 3 - How do you know it is not being saved? PS - When you say it is not setting the cookie, is that a fact or are you simply saying that you are getting your error message instead?
  21. Have you run this code? Do you get any errors? I would think you do since you don't seem to use quotes on your indices. And the use of an @ on the variable that you are trying to retrieve and include in your list is kind of odd since there s/b no errors. Run the code with php's error checking turned on, clean up any errors that occur then tell us what goes wrong.
  22. You have to give the cookie a negative duration I believe. Also - per the Manual - you can't send a cookie once you have generated output, which the echo above is probably doing for you. Also - per the Manual - you are supposed to use all the same parameters (except expire) to delete a cookie. I do this all the time with my secured apps and simply respond to a client's request to log out with a set cookie with a time()-3600 as you tried in one of your examples. Note that the cookie will still exist in your session until the next script is called since they were loaded by the browser. At the end of your current script the brower will delete its cookie and the next start of your session will no reflect it. All this was found in the php manual - a wonderful resource!
  23. You confuse yourself methinks. You said that you only care about the last digit, then you worry about some "foo" values which do not appear to be the last digit. This is simple string manipulation which I'm sure you have read about in the php manual. And if not, I suggest that be your next stop. (It should have been your first stop....)
  24. I thought it was a permissions problem. Change the permissions and it will go away. OR use the advice given to you and skip the whole move and creating a permanent file and just let the system delete the temporary file. OH - and work on your English. Or stop typing on your cell phone. A little respect for yourself and those you wish to read and understand your writings can come in handy.
×
×
  • 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.