Recently I’ve been working on a new website project.
For years I’ve been thinking that I should learn php, but have been putting it off. I’m not a programmer after all.
But I am a website developer, it is a passion you might say, and in these days, you’re behind the times if you’re writing static html pages. So I bit the bullet and jumped in.
I’m not at a point where I want to divulge anything to the world wide web, but I have 60% of my backend control panel built, editing eight or nine tables. I also have one front end page built which to my great joy, outputs a list of files if you enter files.php, and gives you the details of the file when you enter files.php?id=1.
I came up with an analogy to explain my joy of creation to my wife. In the end I didn’t use it, but that’s another story.
It’s kind of like for all the years I’ve been creating websites (probably almost ten, damn that’s scary) I’ve been writing notices and playing them on a notice board. People came and read them, and went away.
Now I’m building a noticeboard that automatically creates the notices depending on what people want to see, records various information about their reactions, allows them to respond to the notice, and to place their own notices.
What was purely a two-directional one dimensional interaction is now so much more. And the fact that it’s coming out of my mind and keyboard is electric.
Anyway, through the process (which is by no means over, I estimate at least a four month development time, if it ever gets finished) I’ve used quite a few resources, so I thought I would leave them here in the hope of
generating hits helping someone out.
The Ultra Basics of PHP
http://www.freewebmasterhelp.com/tutorials/phpmysql – Excellent, simple php and mysql tutorials. This was almost always my starting point for a new part of the code.
The Best W-…A Better Way of Connecting to Your mySQL Database
I couldn’t find the page I used, but:
http://www.hardcoder.com/scripting/php/include_files.php – This page handles the include() statement which allows you to run another script as part of the page you’re running, hence allowing you to pull variables from another page, i.e. a databaseinfo.php file.
http://www.softwareprojects.org/php-variables-07.htm – Explanation of variables and constants. You’ll need to define the database info as constants in the included file (well at least one way of doing it).
Securing what Needs to Be Secured
http://phpbee.com/examples/security/simple_login_page.html – Great simple code for securing pages. I’m sure there are drawbacks of doing things this way, because anything simple can’t be completely secure, but it does the job for me at the moment.
http://www.webmonkey.com/webmonkey/99/30/index4a_page2.html?tw=authoring – Yeah, that’s right, I had to look up how to create a text box.
http://www.echoecho.com/htmlforms11.htm – A very simple page which outlines how to write drop downs in html.
Drop Down Selection Problem
http://codewalkers.com/archives/sqlhelp/434.html – When editing an entry, e.g. game, I returned drop down boxes with the available options. The problem was that on the edit page, it selected the first one by default. So if I went in to edit the title, then the page would change the entries in the drop downs to the first one instead of the original entry.
The page above featured someone with a similar problem, and introduced the idea to me of setting my html code into string variables and then just calling a variable depending on the outcome of an if statement. This simplified things greatly and was a good find.
PHP If Statements
Resetting My mySQL Counters Automatically
http://www.php-editors.com/forums/showthread.php?t=2407 – I needed to figure out a way to update my counters for particular pages (e.g. most popular file, weekly, monthly and annually) automatically. This page put my on to ‘Cron Jobs’ which is a function in Cpanel.
Display Server Time
http://www.activsoftware.com/code_samples/code.cfm/CodeID/67/PHP/PHP_Print_current_time_in_PHP – Self explanatory. It was necessary to test the ‘Cron Jobs’ and counter resets mentioned above.
Sending Emails With PHP
http://email.about.com/cs/phpemailtips/qt/et031202.htm – How can it possibly be this simple? Wouldn’t I have to specify servers and such? I guess not. The wonders of technology.