Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Be able to report your own topics and posts
Daniel0 replied to Demonic's topic in PHPFreaks.com Website Feedback
It doesn't really matter whether people should be more careful in this instance - SMF does not allow you to let users report their own posts. However, I have previously regret that I posted a post and looking at the deleted posts forum I see that other staff do it too sometimes. It doesn't matter for us because we have a delete button, but for all other people I do see why they would like a such option. Like revraz said, just ask a mod or admin if it's really important. Otherwise just leave it. -
Any chance or resurrecting the Calendar Tutorial?
Daniel0 replied to sugarengine's topic in PHPFreaks.com Website Feedback
Chances are a guru, recommended member, mod or admin could write a new calender tutorial... It's likely that the calendar tutorial you are referring to is outdated anyways. -
I disagree. Here is an example: When I first started learning German (foreign language for me) we were taught how to say different phrases. E.g. if you want to say "my name is Daniel" you would say "ich heiße Daniel" (or less commonly, but more directly translated: "mein Name ist Daniel") or if you want to say "I live in Denmark" you would say "ich wohne in Dänemark". This has resulted in a lot of bad habits when I speak and write German and ever since it has been difficult for me to grasp the grammar because of those bad habits consisting of errors. I would've not been able to make a syntactical nor morphological analysis of any German phrase at that time. I was not able to create any arbitrary sentence because I just didn't know how all the grammar worked; I didn't know how languages worked. However, before I started learning Spanish at the school I am at now we had a course in general linguistics which taught, well... general linguistic aspects that exists in all languages (using the languages Danish, English and Latin as examples). This made a good foundation for learning other foreign languages. Spanish was then quite easy for me to learn and right now I feel I am much better at Spanish than German although I've been speaking German for five years, but Spanish in 1.5 years. The reason why it is so is that immediately when seeing the first Spanish sentence and its translation into Danish (my mother tongue) I was able to identify all the grammatical units in it and I knew exactly how the sentence was built. Similarly I believe that learning, roughly, how PHP works along with a webserver etc. will help you a great deal in being a PHP programmer. Using your guitar analogy, I do also believe that you will benefit greatly from learning how a guitar produces the various sounds. Note though that I play no instrument whatsoever. This is my opinion, but it is an opinion based on personal experience and empirical observations of my own learning process as well as that of my fellow students. It's not a biased, subjective opinion that is formed just because this method might very well be more difficult at first, but later on you will see that it was invaluable. Putting this into a PHP context, yes it might work that you are taught "how to create a login system", but if you just learn how PHP works and how its syntax is then you could create any feature instead of asking for "a tutorial on how to write X" and "how do I accomplish Y?". Moreover, you might want to read thorpe's "Learning to think like a programmer" blog post here on PHP Freaks which also deals a bit with methodology. I've also thought the following many times: If people would just bother to read the syntax chapter of the PHP manual then at least 1/3 of our posts in the "PHP Help" forum would not exist. Perhaps, but who says you need a dedicated server or VPS to learn how to setup a WAMP or LAMP stack? Also, you don't have to purchase a super computer just because I suggest a VPS or dedicated. My provider's cheapest plan is $9.50/month (ex VAT). If you're too cheap to spend that much then I'm under the impression that you are not serious about starting a website and I therefore don't believe that your site will ever be popular. Just saying.
-
That's when you can just consult the manuals. I don't know all the PHP and Apache configuration directives by heart either... Encyclopedic knowledge is somewhat useless. For instance, if I memorize all the words in a Japanese dictionary, that doesn't mean I can speak Japanese.
-
It's pretty simple if one bothers to read the manual. Calling header() with the same header twice will override it. Therefore, if $condition_a is true and $condition_b is false you will go to a.php. If $condition_b is true it will always go to b.php. Otherwise you will go nowhere. One might want to continue script execution so the "always die() after sending a Location HTTP response header"-rule doesn't always hold. An example could be cleanup/garbage collection.
-
It's the heredoc syntax.
-
Well honestly... aptitude install apache2 mysql-server libapache2-mod-php5 And you've got yourself a LAMP on a Debian server. How more simple can it be? I'd argue it's simpler than, on Windows, going to some website, downloading a WAMP bundle package, double clicking the installer file. Going through a series of steps where you have to answer various questions.
-
In my opinion, part of being a developer is also knowing how the technology works. I.e. how to setup a LAMP (or WAMP) or whatever you prefer. It's rather essential in order to become good.
-
new to php and mysql, problem inserting into database :(
Daniel0 replied to lieffenno's topic in PHP Coding Help
Actually, you'll want mysql_real_escape_string, not addslashes(). That doesn't really matter. The primary concern with SQL injection is the quotes. Therefore, if you do not care about line breaks and such then you will have no problem whatsoever with using addslashes() instead. If you take a look ad addslashes()'s manual entry, then you will see that is says: -
Unfortunately, my school requires me to use an application called FirstClass. Even though it has Linux support, it has really poor Linux support. It seems that they have stopped development for Linux because the latest version for Linux is 8.315 while for OSX and Windows it's 9.106. It's lacking an entire major release. It's also really buggy on Linux; it has managed to crash X several times. Moreover does it plainly look ugly on Linux. It's trying to emulate some sort of Windows XP theme it appears. In this instance it is not possible for me to pick an alternative because it's a proprietary client on a proprietary protocol on a proprietary server. No alternatives. I wish my school would just switch away from it entirely because it sucks on Windows as well. Also, I like Adobe CS, and it's not available for Linux either.
-
I removed the ::1 localhost entry and that did the trick. I'm not sure why it would suddenly break though. It worked quite fine like that before. Oddly that also fixed the issue with it not loading when I try daniel-laptop in the browser. However, when I ping daniel-laptop I still get the IPv6 address. It's a mystery to me, but now it works again at least... Most likely, I mean, it is called windows vista after all. I shouldn't say that. A big part of being a Linux advicate is not bagging other OS's and understanding that it (Linux) can't be everything for everybody (hell, I'm even typing this msg from my xp machine I use in my studio). Can't we just all get allong? Oh I like Linux, but it doesn't have the software I like/need.
-
[SOLVED] Very strange problam with ! from eregi
Daniel0 replied to redarrow's topic in PHP Coding Help
if (substr($p, 0, 7) !== 'http://') { $p = 'http://' . $p; } What about that? -
There is no code that can be executed after he sends the Location header so calling die() is useless in this case.
-
Script is showing php when it's not supposed to be
Daniel0 replied to iarp's topic in PHP Coding Help
Where does the code come from? How do you include that code into the page? If you do not use the include() or require() functions then you will have to eval() the code. -
date() is just for formatting. If you actually want to subtract time then either just do it normally (i.e. $time-$something) or use strtotime(). The time will, by default, be output in your server's timezone.
-
Script is showing php when it's not supposed to be
Daniel0 replied to iarp's topic in PHP Coding Help
I don't see that code anywhere in the source... -
[SOLVED] Fatal error: Using Up Memory? Suspect a loop
Daniel0 replied to Styles2304's topic in PHP Coding Help
Your first loop runs infinitely, your second loop (nested within the first) also runs infinitely if the condition check within that loop is never met. You are using loops incorrectly. Exactly what are you trying to do? -
Most Effecient Practice For Database Interaction
Daniel0 replied to ordinaryToucan's topic in Application Design
Definitely not open and close all the time. That will just result in unnecessary overhead and if you sometimes get tens of thousands of hits in few minutes then your performance must be top-notch. You should only connect once per script execution (unless you need simultaneous access to a secondary database server of course). -
If you're concerned about that then I would suggest you to use an industry standard framework. In that case your potential future developer will have extensive documentation and he is ensured that you, to some extent, follow specific coding guidelines and patterns. I would recommend Zend Framework, but other popular ones are symfony, CodeIgniter and CakePHP.
-
Quick question about session variable's security
Daniel0 replied to pianoman993's topic in Application Design
You should do fine with that. If you store something like the username or user ID in the session then changing the password would not be a problem in respect to remaining logged in. Don't store the password, you wont need it so there is no point in it. However, there are a few aspects you must consider with session security so I would suggest you to read page 7 of my tutorial "PHP Security" which I recently published here. -
Uh... I meant to say "it wouldn't be difficult"...
-
Well, Opera must have localhost hardcoded to resolve to 127.0.0.1. My computer hostname doesn't resolve correctly in Opera either. I guess it is a system issue after all :-\
-
Brandito, there is a link with some video tuts about that from php|architect around on the internet that are meant specifically for the ZCE test. Try to search around on Google and you might be able to find the link.
-
My VPS is hosted with CheapVPS because... well, they were cheap My site is under development, so there is no point in giving you a link at the moment. I'll put a link on my profile when I'm done. It might take a while though because it is not particular high priority and I'll also be going away for vacation.