Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Explain exactly what it is your trying to do.
  2. There is a typo in my reply, should be: function returnArray(){ $foo = array(); for($i=1; $i<=3; $i++){ $foo[] = $i; } return $foo; } Note you don't want to call return part why through the loop.
  3. How about you post your problematic code?
  4. In your example $i isn't an array. function returnArray() { $foo = array(); for($i=1; $i<=3; $i++){ return $foo[] = i; } return $foo; } Will return an array containing the number 1 - 3. Of course you could more easily achieve the same result by using: $foo = range(1,3);
  5. That sort of validation is at a much higher level to where the framework currently is. At the moment, I'm just focused on getting the very low level functionality in place. The Opt component (which is what I assume your looking at) is not designed to validated user input per say. It is designed to validate function arguments where type hinting is not available.
  6. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=355016.0
  7. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=355012.0
  8. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=355013.0
  9. You are much better off avoiding variable variables all together (they are slow and use a lot of memory). You could easily achieve the same results using arrays in this instance.
  10. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354997.0
  11. It is always best to explicitly tell mysql what fields you want.
  12. You know that running your data through md5 and the like multiple times makes it easier to undo right?
  13. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=354998.0
  14. Sure, but I don't want to physically store the files on the computer like dropbox does Dropbox stores the files remotely.
  15. You don't need WebDav unless you plan on building your own interface. You probably need to explain more about exactly what it is your trying to do.
  16. That's funny, Samba is generally used to mount remote Windows directories. It's allot slower than nfs which you would typically use to mount remote unix directories. As for the ops question, this can be done using Windows file sharing. Have you searched anywhere on the subject?
  17. You need to use absolute paths from within cron as it doesn't have a $PATH variable set and doesn't execute from where you think it might.
  18. Take a look at mysql_real_escape_string or in this case, type casting (you'll want to cast to an int). Your quotes are fine, though you don't need quotes around numeric data types. Try some debugging. $id = (int) $_POST['id']; if (!mysql_query("DELETE FROM availability WHERE id = $id")) { trigger_error(mysql_error()); }
  19. One big mistake is that your not sanitising or validating what is within $_POST['id'] before using it within a query. This could quite easily lead to security issues. Other than that, why don't you tell us what it is you expect to happen and what is actually happening?
  20. You never look very hard do you? http://docs.joomla.org/Beginners
  21. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=354949.0
  22. Have you tried googling for a tutorial on "PHP form validation" or similar? There are literally thousands of results. Do you really want us to write you a custom one?
  23. The reason you can't have a closing ?> is simply a safe guard to ensure that the entire script is PHP (and therefore produces no output besides what PHP itself outputs (echo, print etc etc). Take a look at any PHP framework, they all do the same thing. Your actual issue is exactly what I stated in my first reply.
×
×
  • 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.