Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
This has been asked many times, and Gallery is usually mentioned.
-
date and time that are auto inserted into my database are wrong
Daniel0 replied to sandrine's topic in PHP Coding Help
Check that your server's clock is running correctly. You might want to use NTP to keep the server's time synchronized. -
No, it's not handy. It's stupid, and in my opinion it should be removed from PHP. First of all it has an impact on the performance. The way it works is that it turns off error reporting and then turns it on. You've done that eight times in that small snippet. Secondly, suppressing errors gives you problems when something goes wrong. The errors tell you what is wrong, but if you tell PHP not to report any errors then how are you going to debug it? There are many bad ideas that have been implemented in PHP. Magic quotes, register globals, error suppression (@-operator), safe mode, just to name a few. You don't even understand it even though you're using it. Take a look at this for instance: @$_SESSION["o"] = @$_REQUEST["o"]; That could never result in any errors. The first one is simply an assignment, that won't result in an error unless $_SESSION is undefined or is not an array, but assuming you called session_start() earlier, it will always be that. The second one could never result in an error either because you've just checked that $_REQUEST['o'] exists, so if it didn't exist then you would never have gotten there in the first place.
-
FF 3.5b4. Upgrade your browser. It's two major versions behind.
-
There is no horizontal scroll for me on that page.
-
Well, you should do this instead: <someTag><![CDATA[data here]]></someTag> http://en.wikipedia.org/wiki/CDATA
-
$yesterday = date('Y-m-d H:i:s', strtotime('-1 day'));
-
There are no invalid characters in your string.
-
If mod_rewrite wasn't enabled then he would get a 500 error response code, so that's not the problem. It's more likely to be because .htaccess files is disallowed. If you have access to it, it would be performance-wise be better to make the changes in httpd.conf instead of in a .htaccess file.
-
This is how it works (simplified): 1. User makes a request to the web server. 2. The web server hands over PHP files to PHP. 3. PHP interprets the code and hands it back to the web server. 4. The web server sends the response back to the user. When you submit your form, the user's browser sends another request to the URI specified in the <form>'s action attribute. The type of request is determined by the method attribute. The method can be either GET or POST, and the default is GET.
-
Well, that depends on your implementation. For that to be true then you could say that an instance of BoA would be a particular branch of BoA. You couldn't say e.g. Daniel0 extends PHPFreaks_Member. It might not always be the case that there would be a logical choice for a subclass. If you want a good example of how hierarchical inheritance you could take a look at the biological taxonomy for living organism. Overall you have life. Within life you have the different domains, and within the individual domains you have kingdoms, and so on...
-
Anything that logically is a particular type of bank.
-
Only Windows uses \r for in line breaks. It uses \r\n whereas Unix based systems use \n.
-
Yeah, but the Bank is not the User. You should be using composition instead.
-
I assume you're talking about your snippet site. Commenting doesn't work for me, so I don't think you should worry about people stealing your code. No luck on previewing, getting hints or sorting. Overall major fail. Look up the terms "progressive enhancement" and "separation of concerns". I checked both the old version and beta version.
-
If you don't want people to access it, then place it above the document root.
-
Why would Bank extend User? Inheritance denotes an is-a relationship between the parent and child class.
-
[SOLVED] Get extension code -> file has two extensions ???
Daniel0 replied to doa24uk's topic in PHP Coding Help
Or: $filename = 'hello.world.foo.bar.test'; preg_match('#((?:\.[^.]+){1,2})$#', $filename, $matches); $ext = $matches[1]; // .bar.test -
I don't know about XP, but I'm running PHP fine on Vista x64. XP x64 should be able to run 32-bit programs just fine. Perhaps if you elaborated on how it doesn't work we could help you better.
-
Realy need advices on some protections on my site
Daniel0 replied to disconected's topic in PHP Coding Help
It wasn't me though. It was Tony. Are you stupid or something? -
I just wrote down all different combinations. I knew there would be 42=16 different combinations, so I just kept on going until I had written down the 16th.
-
You can have these scenarios: S={(T,T,T,T), (T,T,T,F), (T,T,F,F), (T,F,F,F), (F,T,T,T), (F,F,T,T), (F,F,F,T), (F,F,F,F), (F,T,F,F), (F,F,T,F), (T,F,T,T), (T,T,F,T), (T,F,F,T), (T,F,T,F), (F,T,T,F), (F,T,F,T)} |S| = 16 Besides, what does this have to do with PHP, and why is it in PHP Help?
-
Maybe try something like akismet? It seems to work really well on my blog, which is largely uninteresting.
-
phpMyAdmin is irrelevant. This does however tell that your DBMS (database management system) is MySQL. If you're using the mysql extension then you need to use mysql_real_escape_string. Take a look at the examples in the manual. You'll have to use it for all values you are going to use in a query to the database.
-
It depends on what DBMS you are using. There is the mysql_real_escape_string function for MySQL. The MySQLi and PDO extensions support something called prepared statements, which I personally prefer.