Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Apache Server only works as localhost but not across LAN
Daniel0 replied to dicky96's topic in Apache HTTP Server
Either your firewall is blocking the incoming connections on port 80, or Apache is only listening to localhost:80. -
That won't work. My current user agent is Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b3) Gecko/2008020514 Firefox/3.0b3, but I'm in Denmark, which is far from USA.
-
Do you have display_errors set to on and error_reporting to E_ALL? If not, then you probably won't see the error mentioned here: http://www.phpfreaks.com/forums/index.php/topic,95562.0.html
-
You can use GeoIP.
-
What IS the best way to link classes?
Daniel0 replied to deadonarrival's topic in Application Design
My point is that the needs might change and you must take that into account when designing your application. Here is another example: When deciding how to integrate the forums with the main site we're currently rebuilding, we had to choose whether to use SMF's SSI.php or write our own code(/classes), we choose the latter option because the former would couple the forums too much with the main site, and should the choice of forum change there would be far too much work in updating the main site's code. -
What IS the best way to link classes?
Daniel0 replied to deadonarrival's topic in Application Design
A registry might be better than a singleton in this case seeing as although you might only need one connection right now, this need might change later on. If you used a singleton then you would only be able to have one database connection and you would have to change your code everywhere the database is used, but that would be really tedious. If you used a registry you could just add another connection to it or have one (the "normal" connection) connection in the registry and create the additional instances as needed. This is of course if you don't like to pass the instances by argument. -
[SOLVED] "must be an instance of string, string given", wait what?
Daniel0 replied to jordanwb's topic in PHP Coding Help
Exactly. -
What IS the best way to link classes?
Daniel0 replied to deadonarrival's topic in Application Design
The reason why we cannot give you a simple answer is because it's a complex problem. There is no golden solution to how you should do it, but there are however solutions which are not good. Entire books are written about this subject so it's hardly something anyone can sum up in a single post. -
[SOLVED] "must be an instance of string, string given", wait what?
Daniel0 replied to jordanwb's topic in PHP Coding Help
The only non-object type you can type hint is an array. -
The default text editor for Gnome.
-
It's just changing the encoding to utf8, I'm not sure why it does that though. It shouldn't break anything.
-
Block user from entering " or ' and other bad chars..
Daniel0 replied to aximbigfan's topic in Javascript Help
Don't block it, but when outputting it use htmlentities() and make sure to escape the quotes before using the values in a query. -
If you want it to be something like this: http://example.com/users/Daniel0/photo/something.jpg then you're better off using mod_rewrite.
-
Would the "File > Save for Web & Devices" option do it? You can select JPEG from there.
-
What do you want to protect yourself? How do you currently do and how does your current code look?
-
Did anyone say otherwise?
-
A registry is used to store instances for global use and a singleton is used for only having one instance of a particular class. Those two patterns should both be used sparsely, but not interchangeably.
-
No, that would be in httpd.conf or an .htaccess file in a folder with AllowOverride.
-
preg_match('/<a href="(.*)">(.*)<\/a>/i', $article, $matches); The match will be stored in $matches. The href will be backreference 1, and the anchor text will be backreference 2. The above regex requires that the anchor tag is always formatted like that.
-
Then why not disable the option?
-
Any chance of a name change?
Daniel0 replied to deadonarrival's topic in PHPFreaks.com Website Feedback
Not only would it be a lot of work for the admins, but imagine the confusion it would create if people were able to change their names as they saw fit. -
Because it's not the same. Try to take a look at overloading polymorphism or at the very least my post above.
-
Tom told me that the the permissions on the attachments folder has been modified to not allow uploads so I believe DaveM is correct in saying he cannot upload. I tried to attach something earlier as well and I couldn't either.
-
Why would it be difficult to debug?