Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You are using php to setup error handling messages in JS. Why? You do realize that you can't have php and JS interact in real time? If you want a real time error message then stick only with the JS code to check the values onsubmit. If you don't want real time, then stick to only php to edit the posted values and send the screen and data back to the user. Can't have it both ways.
  2. Also- should you have a need to post more code in the future, please try and format it to make it easier to read and comprehend. Your first post is pretty bad reading.
  3. Besides what others are telling you has to be fixed, what are you seeing wrong with your code? You don't check anything so it can't tell you if something is wrong. AND - since you simply make a connection and run a query, what are you missing? Your code as written will not tell you anything. Do you know what a function is?
  4. If 1 and 99 and 1000 and 2000 all are the same field and are NUMERIC (not text) that will be difficult.
  5. Can you manually send an email to the problem address(es), ie, using Outlook or something similar?
  6. To give you the details. 1 - get a user id and password from the user 2 - encrypt the password and save the userid and the encrypted password in the users table. When checking a user's login attempt: 1 - get the user's id and password entries 2 - encrypt the password value the exact same way as you did when you stored it 3 - do a query on the table to get the record that matches both the user id and the encrypted password entry 4 - if the query returns exactly 1 record - the user logged in correctly. If not - send them back to login again. As said by Maxxd - you don't return the password in the query, nor do you get it and save it anywhere. The password is not needed once you verify that it was provided correctly. If you need to remember that a user is logged in you create a token that indicates that to your application, such as a $_SESSION var or a cookie but in no way do you store sensitive information in either place.
  7. You need to study on how to build a properly structured relational database. Some ideas you should think about are what attributes you want to link to what data. Such as the name of the page from where an item came from should be stored with that item, or linked to it along with other data directly linked to that item.
  8. Yes - you have many silly little errors. Turn on php error checking (as in my signature) and fix the little typos and see what happens.
  9. The error is telling you that whatever you are attaching to that call to read() is NOT an object or not an object of the correct type. Ex. - If you have $my_obj->read(), it means that $my_obj is not an object.
  10. How about "DAY(date) as date_dd" and "MONTH(date) as date_mm" and then use date_dd and date_mm as your indices into $row? AND definitely change your code to stop using MySQL_* functions. They are going out of PHP soon.
  11. Have you read anything in the php manual that sounds like it might help?
  12. Upon further review: YOu are doing two query calls. You are trying to grab data before you do the fetch, which I finally noticed. - do the query call (just once!) - check if it ran - check if there are rows If all this works: - loop thru the rows and grab the items from the $row and echo them
  13. You're not doing a fetch call. query check fetch process fetched row repeat fetch
  14. Have you checked the manual yet? Read thru the Imap functions.
  15. Not the way one is supposed to design a database. You have people - persons as you call them. They each have some qualities - attributes in db lingo - which consist of things like: name gender address? title? phone? and other things. These all belong in one table unless you find that you have multiples of them, such as two addresses. (People often have multiple phone numbers but I like keeping them stored in the main table under unique names such as 'home','work','mobile' rather than using a second table. So - in your case - you should not be storing gender in a separate table. Especially since a person can only have one gender and it usually doesn't ever change.
  16. What do you need here? The message pointed you to the line. Look at your code and see what you are missing that the php interpreter is seeing. Undefined variable? You haven't yet used the variable but are trying to get a value from it. A non-wellformed numeric value? Whatever you THINK is a number is NOT. Fix your code.
  17. You're having another issue? With what? A variable? Is there a message with that problem? Give us a hand if you want our help.
  18. I dont' see these new lines in your previous code posting (which needs to be posted properly next time!). Have you changed things? And as QOC says - names need to match. Quick lesson: The name attributes of input elements are what you need to look for in your $_POST array upon receiving the submit from the client. That's the connection.
  19. So - I'm guessing that you didn't write this code yourself since you can't even be bothered to look up how to do what I suggested, since you state that you 'echo' statements aren't showing anything. Being new to PHP (or any language) means that you have to do some homework, some reading, some learning, some attempt to comprehend what you are trying to achieve. Not just post some code that you gleaned and can't figure out and ask for someone else to teach you. Make the effort!
  20. I suggested adding some echo statements to show you what the values you are using really are. Add a limit=1 to your query and work through the problem looking at what your code is producing and what it has to work with. That's how one debugs a problem.
  21. I don't see any attempts to debug it as I suggested.
  22. Add some debugging echos to check the values that you are calculating and that could help you figure out the problem.
  23. To become a programmer you have to have an eye for detail. Look carefully at your lines and you will see your error. As for the div by zero - perhaps you should check the incoming parms to your functions to be sure that they are valid or simply check the values to be used in your calc before using them.
  24. uhhh - please define 'no longer works'.
  25. Since this is homework I'll simply tell you that you are missing a semi. Basic mistake - happens all the time.
×
×
  • 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.