Jump to content

KevinM1

Moderators
  • Posts

    5,222
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by KevinM1

  1. Global is bad. Do not use global. Either pass the errors array to the function via the argument list, or don't use it at all.
  2. You have to return the escaped value from the function. Also, your $errors array won't work the way you want it to due to scope. function formValidate($field) { if(empty($_POST[$field])) { return false; } else { $field = mysqli_real_escape_string(trim($_POST[$field])); return $field; } } $result = formValidate('name'); if(!$result) { echo "You forgot to enter your name!"; }
  3. Yeah, begging doesn't work. Then again, I was made Guru, so the standard can't be that high.
  4. This site may help the OP in sizing their layout: http://960.gs/ Also, to the OP, the 'Mauler' in the PixelMauler logo/title is a bit dark. I'm thinking that an ice blue may help liven things up a bit, but YMMV.
  5. Looks nice. One thing - can you make the pane that displays the smileys a bit shorter? It's just tall enough to create a scroll bar at my resolution, which shifts the entire chat frame to the left a bit when clicked. It's not a huge problem, but noticeable and slightly jarring.
  6. Have you tried turning error reporting on?
  7. $percentage = ($exp / $rexp) * 100;
  8. More to the point, += is shorthand for writing: $total = $total + 0; There are other similar shorthand operators, including -=, *=, and even .=
  9. Actually, addslashes() isn't as effective as a dedicated escape function like mysql_real_escape_string() (see: http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string). When in doubt, it's always best to use the database-specific escape function.
  10. Maybe it's just me, but I don't see how the Console.WriteLine() example could be mistaken as something that creates an array, or has anything to do with arrays. For one, arrays always use square brackets. Two, given the arguments passed to WriteLine(), and how they're structured, it should immediately bring to mind sprintf(). Three (finally), dot notation should be familiar to anyone who has worked with JavaScript. Like the others have said, language documentation isn't aimed towards absolute beginners. It's not the documentation's job to teach people how to program. Instead, it's to describe the language in question. No more, no less. I agree that the MSDN's site could be organized a bit better. That said, I haven't had too many difficulties with it because of its search engine, which in my experience is better/more accurate than the PHP site's.
  11. No one is suggesting you agree with the suggestions other people have made. What everyone is saying is that asking for criticism, then reacting in an overly defensive, overly negative manner when people aren't showering you with praise is unacceptable at best. Your reaction to criticism is far more damning than any of the criticism itself. Let me be crystal clear: you are on very thin ice at the moment. Utilize some tact. If everyone is mentioning the same problems they see in your design, then maybe instead of insulting their level of education, you can swallow your pride and work at making the design better. Criticism - blunt and painful as some of it can be (and, to be completely honest, the criticism your designs have received in the last two threads have been as harsh and brutal as a warm cup of hot chocolate, a cozy fire, and a good woman's love on a cold day) - is part of the web development gig. If you can't handle it, find a new career.
  12. Why not install IE8? It's web developer tools allow you to test sites in IE6, IE7, and IE8 rendering modes.
  13. Quick fix for your function. Try: function hideReveal(id) { var myDiv = document.getElementById('id'); myDiv.className = (myDiv.className == "hiddenToU") ? "" : "hiddenToU"; }
  14. So what's the problem, specifically? The only difference I can see in IE7 is the lack of dashed border.
  15. C#'s online documentation is pretty good. It needs better organization, but I've been able to find most of what I need in short order. Link: http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx?ppud=4
  16. Same here. I used to be Sony-only, but as a platform, the PS3 is a bit too spartan to me. Aside from Uncharted and Warhawk, there isn't anything on it that I wouldn't rather play on the Xbox (not a MGS fan). Instead of pumping more money into Home - which is quite useless - Sony should be improving the UI, adding old favorites to the PSN store (I'd pay money for Vagrant Story), and upgrading their browser so it doesn't choke on JavaScript or Flash.
  17. Try: document.frames['frameName'].src = 'newURL'; Where frameName is the name (NOT id) of your iframe. Similarly, obtain a reference to it with getElementById() and modify the src attribute through that.
  18. As always, your best bet is to contact Sony's technical support, especially if your machine is still under warranty.
  19. Have you tried something like myFrame.src = "newpage"; ?? Also, you should report your security concern with Facebook.
  20. The problem isn't within the function. The problem is that you're trying to send an undefined variable - $sel_subject - into the function. In other words, you don't assign a value to $sel_subject before attempting to pass it into the function. Which is exactly what the error message says.
  21. That's because you have a typo. Remember: your funcction is setInputFieldDefault(newValue, inputId) - you need to put the arguments into your function in the correct order. There's no element on your page with an id of Username.
  22. A few things: 1. In your input element, you don't actually supply the new value to the function. Instead, you're passing an empty string (' '). 2. Since the id is a string, you need to put it in quotes (i.e., setInputFieldDefault('WhatEverHere', 'userinp'); ). 3. The if-conditional in your function makes no sense. You're checking to see if the default value equals itself, which will always be true. Instead, you need: function setInputFieldDefault(newValue, inputId) { var inputField = document.getElementById(inputId); if(inputField.value == newValue) { return; } //old value and new value are the same - ignore else { inputField.value = newValue; } //they're different, so assign the new value to the input }
  23. To be honest, you'd be better off asking that question here: http://forums.asp.net/
  24. Can you show me all of your code?
  25. Ah, okay. You need to initialize the div's display to 'block'. Right now, it doesn't have any value explicitly assigned to its display property, so the if-conditional is failing. Also, you need to put quotes around the id of tr1.
×
×
  • 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.