Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. http://au2.php.net/manual/en/language.references.pass.php
  2. classOne should likely be an instance of an object with a well defined interface that Two understands. Static methods in general should be used very sparingly, if your using them allot, your likely not doing things the right way. Firstly, your closeAll() method shouldn't be static. You require an instance if the Database class to use it, you may as well require the instance to close it. Having closeAll() close connections not related to the current instance is a bad idea and goes completely against any OOP design principles, so does this use of the global keyword. Both of them completely break encapsulation.
  3. Attributes need quotes around there values to be valid.
  4. Yeah. mysql_affected_rows() returns the number of rows affected, so you don't need it unless you want to check the query did something (which you should do). Nope. PHP has much better garbage collection and will do it itself.
  5. There would be no need to remove them if you provide sane defaults as my last post suggests.
  6. kohana is a php5 fork of codeignitor. I always though ci looked like a toy framework so haven't given kohana much more of a look in. Not really. You got pretty well locked into certain interfaces. If you don't a bit of a learning curve Zend is pretty much a standard these days. Its got a decent learning curve mostly because it is so flexible. That's the price you pay I guess. Awesome documentation though. I ended up using it more as a library of components though because I found its routing / controllers pretty slow. The good thing about it being so flexible though is that you can work around / only use what you need to.
  7. Also, there is no such index as $_REQUEST['POSTBACK']. Have another look at my code, I'm not sure that defeated know either asp or php too well.
  8. Your logic is floored. By the time you get to your form you still have no way of knowing if those variables exist. The easiest fix is probably just.... if (isset($_POST['FirstName'])) { $FirstName = mysql_real_escape_string($_POST['FirstName'])); } else { $FirstName = ""; }
  9. mysql_real_escape_string() is a php function, not mysql. Its of no use within your actual query like that. See my code above.
  10. Where exactly are these input fields? There not in the code you posted.
  11. No. if ($_POST) { if (isset($_POST['FirstName'])) { $FirstName = mysql_real_escape_string($_POST['FirstName'])); } // etc etc
  12. Age is not a consideration. The manual should be your first point of call. It has nearly all the answers and you don't have to wait for it to respond. IMO, forums are for more complex issues. Asking how a function works is NOT a complex issue.
  13. You need to check your variables are set way back where you first try and assign data to them. Where you do all your mysql_real_escape_string() stuff. You should try to keep code to a max of around 140 chars wide too, its difficult to read otherwise.
  14. You really need to do some html basics tutorials or something. You have code outside of your <body> tags that belongs within it. Namely... <div class='navbar'><ul> <li><a href='/index.php'>Home</a></li> <li><a href='/login.php'>Log in</a></li> <li><a href='/register.php'>Register</a></li> <li><a href='/games.php'>Games</a></li> </ul></div> Which is within your <head> tags for some reason.
  15. $(document).ready(function(){ setInterval(function() { $(".comment-date").each(function() { var $element = $(this); var id = $element.attr('id'); $.ajax({ type: "POST", url: "ajaxpages/php/update_date.php", data: {comment_id: id}, cache: false, success: function(html) { $element.html(html); } }); }); }, 100); });
  16. You cannot simply echo an Object, nor would you, In such a simple case need one. Ridiculous.
  17. They are pretty self explanatory. <link> elements belong within the <head> and <li> must be within a <ul>, <ol> or <li>.
  18. Add this to your .htaccess. <Files ~ "\.ini$"> Order allow,deny Deny from all </Files> This will block access to *.ini files.
  19. You shouldn't be including files via urls, you include files via the file system path to that file. Your going to need to provide more information about what the settings should be, the examples are not helping because obviously they aren't correct and the names of the constants aren't exactly meaningful.
  20. As the error states, $json isn't defined anywhere with you code. Use... $name = $data['json']->file_name;
  21. Which opens a browser. What base url do you see in the browsers address?
  22. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316475.0
  23. Spaces are not 'special', they are invalid.
×
×
  • 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.