Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. if ($operator == 'plus') And then drop defining $plus and $sub, because these do not exist.
  2. Should be like this instead: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Enter Number <input type="text" name="num1"> <select name="operator"> <option value="plus">+</option> <option value="sub">-</option> <option value="divid">/</option> </select> <input type="text" name="num2"> <input type="submit" value="Calculate"> </form> From thereon it should be fairly simple to figure out. You can get the operator using $_POST['operator'].
  3. I also like having code completion and code hints (haystack or needle first, anyone?). I also like when editors point out syntax errors like word processors point out spelling errors. I also like being able to Ctrl+Click (or something similar) on a non-built-in method, class or function to go to its definition. I like built-in debugging, profiling and possibly support for something like PHPUnit. Sure, I could code in Notepad (or something slightly more advanced than that like Gedit or Notepad++), but I much prefer an IDE. For minor edits on Windows I'll use Notepad++ and either Gedit or Vim on Linux, but only for minor edits.
  4. This is something we're obviously not going to help you with. Besides, this has nothing to do with core PHP hacking, which is the act of modifying PHP itself and/or writing extensions in C for PHP. Locked.
  5. And that's the reason why you always write your code in English regardless of what your mother tongue is. You may be able to understand it, but potential future team members might not, and people you're asking for help might not either. It's reasonable to expect that a programmer knows English, but it's not reasonable to expect that a programmer knows any other language.
  6. If you want to waste your time then it's fine by me. I just think it's stupid. Either way, you'll always be coding with an editor. Notepad is also an editor, albeit a crap editor. It doesn't even understand UNIX line breaks, nor does it have automatic indentation, syntax highlighting, bracket matching, etc. It cannot open huge files either. It'll simply freeze on large files where other editors open them instantly.
  7. Store the taken names somewhere. When somebody enters a name, check if it's in the database. If it is then it's taken, otherwise it's available.
  8. You can't just do that. It's going through several conditions and loops and being checked against other values.
  9. We have this one: http://www.phpfreaks.com/tutorial/data-joins-unions Otherwise there is the manual on JOINs: http://dev.mysql.com/doc/refman/5.0/en/join.html
  10. Well, more like: if (is_array($userChars)) { // foreach loop here }
  11. Just check if it's an array and don't run the loop if it isn't.
  12. The manual covers the syntax quite fine.
  13. Why don't you just read the code? It's calculated the way it's written in the script. Your question doesn't make much sense, really.
  14. You expect us to read through a huge chunk of code, which is largely uncommented and written in French?
  15. SELECT news.*, users.firstname, users.email FROM news INNER JOIN users ON news.user_id = user.user_id WHERE news.news_id = 123;
  16. What's the mime code? IE doesn't support XHTML.
  17. You could also use Javascript to update it without refreshing.
  18. Actually, error_reporting = E_ALL|E_STRICT would be better for when you're writing code. You'll also need to use mysql_real_escape_string to protect yourself from something called SQL injection.
  19. It's because $userChars isn't an array, which makes it an invalid argument for foreach that expects an array.
  20. Find a newer tutorial. It seems like the code is relying on what's called "register globals", a deprecated practice that's disabled in recent versions of PHP. Read these chapters of the manual, and then read tutorials: http://www.php.net/manual/en/langref.php http://www.php.net/manual/en/security.php http://www.php.net/manual/en/features.php Don't read the function reference because that's what it is, a reference.
  21. No, you can just upload the classes yourself. The only dependency Zend_Feed has is Zend_Exception, so you would just need to upload the Zend/Feed.php, Zend/Exception.php and Zend/Feed/* files. Zend Framework can be used as a library as well if you wanted to.
  22. It says the output was sent on line 1. Make sure you haven't accidentally slipped in whitespace before the PHP opening tag.
  23. Zend_Feed
  24. Could you perhaps show us the code that sets the variable?
×
×
  • 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.