I think I have sufficient knowledge in html and css to move onto php. Which
is why I bought roughly 10 different php books, and signed myself up to lynda.com to watch their video series (essential training).
This means I've learn't the following (roughly, though the light-bulb moment still hasn't happened yet):
Using PHP and HTML interchangeably
Using phpinfo(), and understanding all the parameters displayed
The famous Hello World!
Adding Comments i.e // /* */ hash key doesn't work on my keyboard
And all that good stuff....
So far this has been learnt from online tutorials, going through roughly now 7 chapters of the book "Friends of ED, PHP Solutions - Dynamic Web Design Made Easy" and first few chapters of the lynda.com video series (just so you can get an idea of what I should know)
I've only been at this 4-5 days so it has been a lot to digest, but I found looking at code that I didn't understand, reading it all, going back to earlier chapters to brush up on certain things gave me clearer understanding and then the "Aha!" moment.
The problem is, I think I would progress much better knowing the answer to my specific question (and I think I may know it, but I need it explained). But the way I'm going to ask it isn't going to be short or simple at all, if anyone is willing to then answer a dummies question, I'd be forever indebted to you. I'm learning PHP first as a hobby, and a new found love for programming (scripting?), second to be able to develop solutions that I'm continuously tired of employing others to do, or buying products to achieve it, and then my most distant objective is to freelance (why not put your eventual knowledge to good use right?).
Right, first to get the skeletal part of the question out of the way:
I keep thinking that a site with PHP scripts need to all interact with each other in some way, thus meaning you have to specifically know in what order they go, for example:
Let's say a user first has to log-in (for our sake, let's say it is an E-commerce website), on login they get their details displayed somewhere on the page they are currently on (usually on the far top right in the header), and then they can also go to an accounts page to change info. Then the site has a script for validating user registration, logins and also sessions timers (don't know what to call it) so that users are logged out if left inactive for a while (no risk of others using their account). A shopping cart also exists and a few other features like a cms and so forth...
Would all these things have to go in a specific order, and do they have to somehow connect as one block of code, or can they go anywhere in the page (assuming order from top to bottom, if infact it does need ordering)?
Now, let's use a real world example so you understand my question in more depth. The site I'm going to use is specifically what I'm going to set myself as my first (and long-term project), mostly because it requires features that you can create independently and test them before adding them to a website (logging etc):
The websites are as following:
Games at King.com - Play Free Games
Play Games Online For Cash - Solitaire, Bejeweled 2 and More Online Games - WorldWinner Cash Competitions on GSN
Play and Win Cash Games - Skill Addiction
Online Games and Free Online Games - GameDuell
but I'm only going to use one of them as an example, though they are pretty much in some way or another have the same features.
Questions will be dotted around this explanation just so you know. If I specifically would like an answer to something but it doesn't seem clear that I would like one, I will bold.
Starting with the website king.com,
the front page displays different things depending on whether a user is logged in. I suppose this is done with PHP? and if not that atleast asp or jsp or something?
For our sake, let's just say that it's done with php. Would this mean that you'd simply need an if statement to see whether a user is logged in or not, and if it results in false, the things that load are different to those if you were logged in.
For example, the right sidebar under the search bar displays as an advertisement if you are logged out, but if you are logged in it shows a user menu.
Under that if you are logged out it only shows you the games available under categories, and the jackpot for the top game in a category. If you are logged in, you instead get a whole host of other sidebars located to the right, with all games listed under each category showing the jackpot available for that game. Would these all have to go through the if statement individually or could they in some way be done in one go all together?
I think with that example in mind, you should get the type of question I'm trying to ask, which means looking at the different functions of a webpage top to bottom and asking whether they actually have to be performed in a specific order, do they have to be scripted individually, and does the block of code have to in some way connect with each other.
Aside from that question, I have one, maybe two more questions if you don't mind. The first I think has to do with both php and databases.
When a user logs in, on the top right they have a box showing amount of jewels, account balance, and a set of icons that label the following:
"My account page", a page different to the home page, sign-up and see what I mean.
"My Games Page"
Let's consider the account balance and jewels first. This is only a guess, as I haven't move into the mysql chapters just yet. But is a database made with predefined fields? So under a users name there would be a field with jewels, and everytime a user did something to acquire more jewels, php would simply converse that to the database and update the amount of jewels a user has.
Does PHP simply go to the database, check under a users table, and look at the field jewels to grab the number of jewels that user has to display it on the page that user can see?
Guessing, if this is the case, the same would hold true for the account balance?
And would the same be for any currency, or features such as add friends etc?
Last question (I promise), a lot of wordpress themes only have 1 index.php file, yet they can create a ton of pages that can't be seen even if you log-in to your own ftp and check the public html folder. Is this because most wordpress themes layout is the same throughout most of its pages and the only thing that needs updating is the content displayed (images, text, links and so forth), and if so does that mean that all it does is communicate with a database to grab the content inserted to display?
Like a site such as [Play and Win Cash Games - Skill Addiction, when you click on my community for example, it sends you to [url=http://skilladdiction.com/blog/]Play and Win Skill Gaming - Blog](http://skilladdiction.com) but shows no extension, how is that?
I'll stop there, as I think I'm pushing it a bit I'm finding all this so fascinating yet frustrating because I feel if I knew some of these answers, a lot of the learning would come a lot easier to me.
For those who think, "who the hell is this kid and why is he asking so much as his first post", I think I, at the very least, owe you some form of background.
I've been using computers since I can remember (I'm 22), so definitely 12+ years, even back when we used floppy drives, and used windows prompt as an interface (I think that's it, I'm not really sure, as I was really young). My dad had a computer with a sports betting software that allowed him to compute several calculations. This was to bet on football teams winning, losing, and drawing in the league. Needless to say, he won quite consistently so the software can't of been that bad. Back in those days, the whole shadoodle would have been equivalent to a system worth several thousand (I think).
From there I developed a love for playing multiplayer games, and attended my first Local LAN party at the age of 15 (local meaning national really, but because this forum brings people from all walks of life, it can be considered local).
I became ridiculously good at playing games and became what is now called a PRO Gamer, earning money going to different tournaments and winning. I got sponsored by globally recognized brands such as Intel, AMD, EA GAMES, Razer, Puma, Addidas, Alienware (now DELL, so basically sponsored by DELL), and my most recently pleasing sponsor (LG), for sending me this great LG FLATRON W2252TQ, free of charge.
Though my most memorable sponsored product given to me was the XPS Gaming Laptop (I don't think this laptop needs any introduction ), though it had to be returned due to the ending of my contract, and unfortunately, my gaming career. Although I did get to keep a lot of sponsored gear, including my LG monitor which is great.
I made my yearly income doing this, and have till now enjoyed it as both a hobby and work. But I've now found another deep enthusiasm towards web development and design, and being the way I am, I become obsessive and spend a ill inducing amount of hours dedicating my time towards it (mostly because I refuse to be "just alright at something", I have to be the best, damn I'm competitive).
That, in a nutshell, is me.
My name is Jason, and anyone wanting to check out some of my gaming history can check under this username. I look forward to p*ssing incredible amounts of people of with my bombardment of questions, but on a serious note, I hope to both learn and teach eventually
Thanks, and till next time, or atleast until someone replies