Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. Initialize $arg2 to some value that's impossible for it to be. If you expect $arg2 to be a positive integer, make its default -1. That's how it was done before "null" became a language construct.
  2. This is the only way my suggestion will work. Inside your nav include file, when you print the menus, change the color of the menu item which corresponds to the page you're on.
  3. Re-create the form in HTML by hand. Use the PDF as your design guide, don't use it as the actual basis for your website.
  4. You're also not really doing functions right. You pass in a variable that's never used and then use globals to pull in two more that ARE used. Pass variables into functions, you defeat their entire purpose using global. Also, it's possible that field in that row is just empty, or non-printable characters like an HTML tag.
  5. Wherever you output the menu, check to see which page you're on and change the color of that menu item.
  6. You can't edit PDF files easily, that's the whole point of them. You certainly can't edit PDF files using a rich text browser editor. What are you trying to accomplish here?
  7. And for a little bit more information, I wrote a whole article on the == operator
  8. Please note that this is not a board for "give me the coding." We're here to help you learn, not to do it for you. Also, please try to include a better subject next time. Only one person is helping you because you posted a thread titled "need PHP coding help" in a forum called..."PHP Coding Help."
  9. I like eclipsePDT, though it's slow. I'm actually using Geany now and I love it, but as far as I know it's linux-only.
  10. The variable name is the key: foreach ( $ini_array as $var => $val ) { echo "The INI value of {$var} is {$val}<br />\n"; }
  11. View the source of the page. I bet you'll see your PHP script in its entirety.
  12. That error comes from a failed query. Mysql_query returns false when the query fails. False, as you may know, is not a mysql result set resource. That's where the error comes from. If your mysql_query returns false, echo mysql_error(). That will show you why it's failing.
  13. while(is_file("../projects/test/save.lock")){ usleep(500000); This race condition is known as the dining philosophers problem
  14. One line, actually: file_put_contents('log.txt', $_POST['username'] . "\n", FILE_APPEND); -Dan
  15. So you want to generate random numbers that always add up to the same value? That's not how randomness works.
  16. How is this at all relevant to anything we're discussing? This parses two distinct values from an HTML document. The question is on parsing an entire document formatted like an INI file.
  17. You would wrap the function around the variable just as you've provided them. Take the function, put it around the variable.
  18. Or you could parse this INI file with parse_ini_file
  19. MySQL is not at all involved in this. Also, like I said, simply removing the last condition from my code would have allowed any input as long as an input was provided. No. The LENGTH is being compared to 1, not the value.
  20. For perspective: I'm 28, and I worked professionally in college. Including that job as a programmer in college, I've had 5 jobs in 10 years. My salary has doubled in those 10 years, and I've always quit in favor of a more advanced company (except one time I was fired for "performance reasons" 2 weeks before my stock options would have vested and 3 weeks before the company was sold for $100 million. Convenient for them that I was slacking off right then).
  21. The quotes are only optional when there's no spaces in the string that would otherwise be quoted.
  22. That credit card number fails to checksum! This one works: 4111111111111111 Seriously though, the only time data scaling becomes a problem is when you've either written something wrong, or it's a tool so complex it should be done some other way anyway.
  23. if (!isset($_POST[$fieldname]) || (empty($_POST[$fieldname]) && $_POST[$fieldname] != 0)) { Break this code down: if ( !isset($_POST[$fieldname]) || ( empty($_POST[$fieldname]) && $_POST[$fieldname] != 0 ) ) { So we have: If it's not set OR (it's empty and it's not equal to zero). Looks like you want the field to be required, and not zero, right? Required and not zero: if ( !isset($_POST[$fieldname]) || empty($_POST[$fieldname]) || $_POST[$fieldname] == 0 ) If zero is an allowable value, just remove the last bit. Also, =! is not an operator, so I don't know why you would "switch that up".
  24. While quotes are ostensibly optional for spaceless attribute values in HTML5, quotes are not optional for XHTML, and some parsers/browsers will not like unquoted strings. There's no reason that I can see to not just "do it right" and quote all your attributes.
  25. Usually not, no. AOL specifically forbids bots of this type, so doing this normally requires extensive hacks.
×
×
  • 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.