trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
http://au2.php.net/manual/en/language.references.pass.php
-
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.
-
hidden input field type doesnt store complete value
trq replied to devilinc's topic in PHP Coding Help
Attributes need quotes around there values to be valid. -
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.
-
There would be no need to remove them if you provide sane defaults as my last post suggests.
-
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.
-
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.
-
You haven't executed the update query.
-
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 = ""; }
-
mysql_real_escape_string() is a php function, not mysql. Its of no use within your actual query like that. See my code above.
-
Where exactly are these input fields? There not in the code you posted.
-
No. if ($_POST) { if (isset($_POST['FirstName'])) { $FirstName = mysql_real_escape_string($_POST['FirstName'])); } // etc etc
-
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.
-
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.
-
Markup Validation Service Errors HELP \= need help am stuck ergh
trq replied to Minimeallolla's topic in HTML Help
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. -
update a number of divs at a certain Interval (partially working)
trq replied to shortysbest's topic in Javascript Help
$(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); }); -
Post your current code.
-
use same variable in two or more different closed php tags on same page
trq replied to comparebest's topic in PHP Coding Help
You cannot simply echo an Object, nor would you, In such a simple case need one. Ridiculous. -
Markup Validation Service Errors HELP \= need help am stuck ergh
trq replied to Minimeallolla's topic in HTML Help
They are pretty self explanatory. <link> elements belong within the <head> and <li> must be within a <ul>, <ol> or <li>. -
Add this to your .htaccess. <Files ~ "\.ini$"> Order allow,deny Deny from all </Files> This will block access to *.ini files.
-
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.
-
Grabbing key out off array for use within function
trq replied to isimpledesign's topic in PHP Coding Help
As the error states, $json isn't defined anywhere with you code. Use... $name = $data['json']->file_name; -
Which opens a browser. What base url do you see in the browsers address?
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316475.0
-
Spaces are not 'special', they are invalid.