I'm very, very, very new to PHP coding. I'm so new I don't even know what to search for to help solve my problem. I'm sure you pros will be of some help during my first project here.
Basically, I'm trying to learn PHP in the same way I learned HTML... by seeing how other people do things, then hacking it to pieces to make it work on my own. Somewhere along the line, I'll figure out what I'm doing.
For my first project, I'm trying to implement a user registration system so I can protect certain parts of the site. I got a script to help me out in that arena, then hacked it apart to make it work with my site. It works perfectly for PHP scripts put in the root directory, but not for scripts put in other directories. Take a look at my site for an example:
http://www.tim.cx/
See how at the bottom of your screen there's a login box/register link? Once you're registered and logged in, a cookie is set. Then, when you return to the homepage, the login box is gone and some text saying "welcome, user" is displayed. The 'user' is a variable containing the user's name they registered with. It works fine on the test "members.php" page, and it works fine on the "index.php" page. However, I'm trying to implement the same thing on the photos page and I'm running into problems.
The script works perfectly except for the variable that contains the user's name. When not logged in, it shows the login form. When logged in, it just says "welcome,". There's gotta be a way to make that "user" variable be passed from directory to directory.
As I said, I'm very new and don't even really know how to ask my question. Hopefully everyone has understood it and I've supplied enough information.
Thanks everyone. I look forward to learning all I can through my own tinkering and this board, and maybe even help some others in the future.