Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Why are you posting code that doesn't pertain to what you want solved? Sorry but I don't understand your last post at all. IF YOU want a color effect on a td, you need to have something akin to: ...style='color:$color_value;' in your td statement. AND why don't you just make the rest of your static style attributes part of a class and avoid having them repeated for each td element? A much wiser and more efficient way of doing things.
  2. I fail to see what the strtolower is supposed to accomplish. Also - if you want to change the color you need to do it in the style but you are not. Also - $stormintensity is a string; $k is not defined (to us); what do you expect to get from "$stormintensity[$k]" ?
  3. I dont' see where you use $tintensity in the <td> line.
  4. You have to have the necessary header in the mail() call. Read the section in the manual - it will tell you what you are missing. Just because you have checked the result of the call to mail once doesn't mean it can't happen at any point in the future. Put the check of the result back into your code.
  5. Leave the quotes off the substituted variable.
  6. You are not checking the result of your call to the mail function. Why? Also - what is the contents of your $email array? You don't show us. Hopefully it is a properly formed return address unlike your "additional parameter" that you have included. You should read up on the mail function in the php manual.
  7. Of course you can set something up. Make the site secure so that they have to login to use it. Only give them login credentials when they make a donation and you receive it. Write the code and if you have a problem THEN post it here for help.
  8. This code seems incomplete. You don't check if you actually got a result from your query, yet proceed as if you did with some comment that suggests you know what to do but just haven't shown us. Then you try to show a redirect header, but you have made no provision to complete the name of the script to be sent to. And most importantly - you haven't expressed any sentiments about your problem and what you perceive to be the issue other than to suggest you have a problem in your title.. Help us out!
  9. Think of the function as the pitcher and the call as the catcher. If the catcher doesn't have a glove he can't catch it. See my previous example please. Or not.....
  10. When you call a function that does a "return $value", you have to have something in which to return the value, no? $result = password_strength($confirmed_password); Then process the value of $result afterwards.
  11. It's simply a poorly designed piece of code. You've got 20 lines of code that people are looking at and advising you to change simply because it's not readable. For something that is simply simple, you've made it difficult to understand. Why use a Boolean value, which is intended to have TWO values when you have a condition that could have THREE answers? Why make it so complicated when you could simply return SESSION,COOKIE or NONE as your answer? Even you can't figure out this logic to determine what is wrong with the code. As for your current problem, you are asking it to display a variable ($_SESSION['user']) that doesn't exist. Simple as that. Your own code has determined that to be true, but your use of that code is making you try and display it anyway. Try to write code that is readable and understandable by another person completely unfamiliar with the workings of it. If you are ever going to write "robust code" for a bigger project someday, where others may have to work on it after you, you will have to ensure that it can be understood. Good luck!
  12. objnoob: You pick on my post when I was only expressing my agreement with the original sentiment expressed by the guru mac_gyver??? My post explicitly referenced multiple occurrences of this action, not just this particular individual. Additionally, I don't know what you are referring to with: "A better understanding of OOP and the PDO class." - it is not anything I posted and was in no way the target of my post. Frankly, I think you should lighten up and be sure you are flaming the right poster
  13. You process the results set with a while loop as in : while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { do your thing } Also - you have taken advantage of PDO's prepared queries but you are not doing the primary thing behind them: substitute parmaters. Change the where clause to : WHERE valid_users.id=:id "; and the Execute statement to: $stmt->execute(array('id'=>$myid)); This is the whole reason to use a prepared query.
  14. In addition - one cannot use $1,$2, etc as variable names.
  15. At Last! Somebody has come forth and said what I was thinking every time some 'noob' (and others) posted their own idea of how to utilize the PDO interface. Classes, definitions & functions all written to simply run a couple of php functions to get some data. What a colossal waste of energy.
  16. Sorry - your code is just difficult to follow.
  17. Your query ONLY selects one column. Therefore, that is the ONLY column you will retrieve from your db. Seems like you need to change your query
  18. You are not showing enough code to validate what you want us to examine. You don't check the results of the bind-param call. How about giving us enough info to help you out?
  19. What do you define as a "php condition"? I am unfamiliar with that term
  20. You can also write $number1 = $number2 = $number3 = $number4; But if you are doing this - why do you even HAVE 4 variables? Sloppy code work?
  21. I would think that making your query more specific would lessen the load on your database. Why query all the records when you only want a subset?
  22. just realized you had an 'elseif' there. In that case go back to && instead of || (as I suggested) but put a ! in front of a set of parens wrapping all your tests. elseif (!(test && test && test &&test)) { echo error }
  23. Uh...... try using OR instead of AND and then look for the negative of the tests ( ! )????
×
×
  • 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.