Thursday, November 12, 2009
Sessions and computer clocks
What I finally discovered was that he had recently changed his computer clock (to the wrong time). So the PHP session was working perfectly fine, just each time he logged in, the session compared the time to his computer and determined that his session had expired.
In conclusion, if you ever have a situation where you cannot log into a website (and you were able to do so before), please check that your computer clock is accurate as well as confirming your username and password.
Tuesday, August 18, 2009
OTF FEO website
Tuesday, June 9, 2009
SEO progress
Monday, June 1, 2009
Pagination Upgrade
Friday, May 8, 2009
mysql_pconnect Dreamweaver
Thursday, April 30, 2009
CSS page selected with PHP
Thursday, April 23, 2009
Dreamweaver and md5
I started out my PHP programming years relying heavily on dreamweaver to do my database coding. At the beginning I was restricted in my abilities to what dreamweaver was capable of doing, yet over the years my abilities grew and I now only use it to do the repetitive grunt work.
One thing I could never figure out was how to create encrypted password security systems using dreamweaver and I just figured it out using md5 and it is a piece of cake. I am posting it because I could not find it on google and thought other people like me could be looking for the code. I am using Dreamweaver CS4 at this time, but I don’t think that will matter.
For this tutorial, simply use Dreamweaver to build your username/password insertion page and login page as normal and I will show what you need to modify to make it work.On to the code…
The code that inserts passwords into the database…..
$insertSQL = sprintf("INSERT INTO `admin` (admin_name, admin_pass, admin_level) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['admin_name'], "text"),
GetSQLValueString(md5($_POST['admin_pass']), "text"),
GetSQLValueString($_POST['admin_level'], "int"));
As you can see, I simply inserted md5 with a new bracket around it…. That’s it, it is inserted into DB as md5
The Login page
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=md5($_POST['password']);
$MM_fldUserAuthorization = "admin_level";
$MM_redirectLoginSuccess = "login_good.php";
$MM_redirectLoginFailed = "login_bad.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_mine, $mine);
$LoginRS__query=sprintf("SELECT admin_name, admin_pass, admin_level FROM `admin` WHERE admin_name=%s AND admin_pass=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $mine) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'admin_level');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
this is a standard Dreamweaver generated login page, on this line $password=$_POST['password']; , again I simply inserted md5 and the bracket - $password=md5($_POST['password']);
Thats it, Dreamweaver and md5, piece of cake
Wednesday, April 22, 2009
Pagination Update
Thursday, April 2, 2009
New site: sonnygalea.com
View it here www.sonnygalea.com
Wednesday, April 1, 2009
New site: events.hemophilia.on.ca
View it here events.hemophilia.on.ca
Friday, March 6, 2009
I just joined linkedin.com
Better too late than never for joining this website, there are so many social networking web sites, it is hard to decide which are worthwhile. So far, this one seems to be worth it.
Tuesday, February 17, 2009
SEO progress, week 1
Many years ago I had could come up on the first page of yahoo and google with different combinations of Toronto, design, freelance, ect. Then about 4 years ago I switched my website to Flash and soon dropped off the map as far as search engines were concerned. Other factors could have been that I stopped adding my link into the websites I had built as I started to do more sub contract work, and websites for large corporate clients which wouldn’t allow my link in the footer.
So with that bit of history behind us I will explain what I have done in the past few weeks in my attempt to increase traffic. The first step was a website redesign using CSS (Cascading Style Sheets) and adding better meta tags. The website is now text based and search engine readable. I installed Google Analtycs to track my traffic sources and Google Webmaster tools to help refine my content and keywords. I added some web 2.0 features such as an RSS feed and this blog, from what I have learned the blog will be very beneficial to search-ability and page rankings.
I have never gotten business from random clients finding me on search engines, my business has grown from word of mouth and I have been quite satisfied with that. This is a long term experiment and when it is proven to be successful, it will be a service I will offer to clients. Please drop in and watch our progress.
Friday, February 13, 2009
Pagination Code
Here is a nifty piece of code I wrote last week for php pagination. What is "pagination" you might ask. For me, it is a system of numbering pages for searching and displaying database results which are too much to display on one page. Basically, you break it up into multiple pages.
I hope this is commented well enough for someone to understand. The next post will hopefully be on art or something not so dry as PHP code.