Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. For those of us who do not read people's attached files, could you show the specific code you are worried about?
  2. In that case you should just leave it all alone.
  3. I always put that line at or near the beginning of my scripts.
  4. If you wrapped your code in the proper tags it would be easier to work with. Also - if THIS code is not actually what produced that message, please give us the right code.
  5. When you finish this project, I highly recommend you read up on how to truly use CSS. Embedding your entire redundant style= string into a php var which is going to also be redundant(!) is not the way to do it. IMHO. Guessing here - but I don't think you need the quotes on the color variable. Just look at the previous color setting you have made: color:$FFF. No quotes there. What puzzles me about the strtolower (and it is not what the function call does) thing is you are converting a string that your code seems to be responsible for producing, so why not just create it in lower case - WHICH you are smart enough to already be doing, so why the function call? Lastly - forgive me if I'm still not understanding - you seem to be setting the var stormintensity into the style string you build,but it has no defined value at that point. Therefore, you are not assigning any (override) color based on content.
  6. My bad - I should of seen what objnoob pointed out about the error. So - the query failed. If error checking had been done ( if (!$results)..... ) you should have seen a hint as to what part of the query was invalid.
  7. 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.
  8. might help if we could see line 14
  9. 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]" ?
  10. I dont' see where you use $tintensity in the <td> line.
  11. 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.
  12. Leave the quotes off the substituted variable.
  13. 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.
  14. 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.
  15. 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!
  16. 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.....
  17. 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.
  18. 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!
  19. 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
  20. 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.
  21. In addition - one cannot use $1,$2, etc as variable names.
  22. 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.
  23. Sorry - your code is just difficult to follow.
  24. 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
×
×
  • 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.