trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
What have you done to narrow the problem down?
-
File reading and writing PERMISSIONS minor problem
trq replied to qskypro's topic in PHP Coding Help
You need to set the permissions on the files you DONT want to write to, not the scripts that may write them. -
Use a string within a function called from outside
trq replied to etrader's topic in PHP Coding Help
Functions accept arguments. This is how you pass data into a function. -
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=341287.0
-
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
Your style sheets aren't working? I thought your includes weren't working. Did you read cag's reply? -
There is a three part series on this site which is pretty darn good: http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect
-
This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=341242.0
-
It depends really. I spend allot of time with my headphones on when I'm at work, but it's more just to prevent outside distractions. At home, I might have the TV or stereo on in the lounge room, far away from my office, but I'll rarely use my headphones. I guess I always need a bit of noise though.
-
Looping through a result set is normal and provides the most flexability. If you had methods that returned a formatted result set you would need to mix markup into your models. This is NEVER a good idea. The Model class that you have shown is also fare to specific to have all other Models extend from. Your base Model should have nothing more than what is needed to be shared to every other Model and should likely extend PDO not have a dependency on it.
-
The term is misunderstood by the media. I consider people like Linus Torvalds, Guido Van Rossum and Larry Wall to be true hackers, not these script kiddies the media harps on about.
-
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
I'm not sure what 'via netbeans' means. You need to run error reporting on in your php.ini. Calls to require_once will generate an error if they fail. -
It stays isset(). You are checking to see if the $_SESSION['username'] index exists. This will only exist if the user is logged in.
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=341206.0
-
Have you got a specific question / problem? We are not here to write code for people.
-
You would need to right a custom function for this. It's not really that common a request.
-
How about changing the forum structure ?
trq replied to Morg.'s topic in PHPFreaks.com Website Feedback
We had the boards partitioned in a similar fashion a while ago (long while ago actually). The problem is that newbies assume every simple issue is complex, and there wasn't much activity in the advanced section. Keeping it all together means less moderation and more traffic in the one place. -
This topic has been moved to PHPFreaks.com Questions, Comments, & Suggestions. http://www.phpfreaks.com/forums/index.php?topic=341193.0
-
Awesome. It's good to see your making progress.
-
I'm not usually trying to be nasty when I say things like "go break your problem down into smaller pieces and come back when you have a more specific problem", I'm trying to get people to think for themselves. Most things aren't as difficult as they seem once they are broken down into smaller pieces. The company I work for is in the process of putting in a tender for a Government contracted application. We got a 'functional requirement outline' on Monday which is basically the same sort of thing. Ours (unfortunately) however for this particular project is 257 A4 pages long.
-
Of course, if you understand how both systems work. What I'm trying to get at is how to think like a programmer instead of spoon feeding yourself through tutorials. Allot of people doing tutorials are in a rush to get things working so they tend to skim past the explinations of why they are typing the crap they are typing. Even if people do pay attention and read this stuff allot of tutorials may not be particularly well written and not explain allot of stuff anyway. Do yourself a favor and try to break the task down yourself. Once you have the task broken down, you simply need to go through each step and create the code. SOme steps may need to be broken down even further along the way. As an example, your comment system. What does it need to do? [pre] 1) If a user is logged in, display a button at the bottom of the each blog post. 2) Once button is clicked, open a text area for the user to post there comment in. 3) Submit the form to the database and add a new record. [/pre] Obviously, this isnt enough information to start coding (for some, it would be as the missing pieces are pretty clear already). So, let's go through the list again and ask ourselves some questions and/or jot down idea.. [pre] 1) If a user is logged in, display a button at the bottom of the each blog post. *) How exactly do we check a user is logged in? *) We can check the $_SESSION array for the flag we added to it when we logged a user in. 2) Once button is clicked, open a text area for the user to post there comment in. *) We can likely take the user to a new page to do this. *) Or, get a little bit fancy and implement it using JavaScript to slide open an already existing text area. 3) Submit the form to the database and add a new record. *) How can we relate this comment to the article? *) Each article has an id in the database. When we create the article (and the optional comment button) we can place this id in a hidden form element. This way it will get sent along with the comment. 4) Database structure: *) Now that we know we will be relating comments to an article via the articles id we can design a simple database. *) What fields to store? *) A comment id, and article id and maybe the users id so we can put there name on the comment. *) How do I get the users id? *) It should likely be in that $_SESSION array I am already using to see if the user is logged in. [/pre] Now we are getting much closer to something that can actually be turned into code. From here, you might go through it again and add in a few more ideas / thoughts. You might need to go and add some stuff to your login system to account for the data your going to need. With this kind of plan in place you don't really need any specific tutorials. If you get stuck, you can come to a forum and say "Hey, Iv'e got this login script, how do I add a user id to the $_SESSION array?" Better still, if you've gone through a similar process to create your login script, you likely won't need to ask those types of simple questions because you will understand completely how this system works, why and how it does what it does. Hope this helps.
-
Well, you just said you have your login 'all in place'. Do you understand how it works?