Author Archives: Lee Thornton

Lee Thornton

About Lee Thornton

Owner and Lead PHP Programmer of ASA Web Design, Inc.

Detect SSL mode or when page is in secure mode

if ($_SERVER == ‘on’) {
// secure mode
}

if ($_SERVER  !=  ’on’) {
// NOT secure mode
}

Tags: PHP and Mysql
Posted in PHP and Mysql | Leave a comment

Google “site not safe” warning removal

Many people ask me why Google shows a warning that says “this site may not be safe” when someone searches for their website name. They want it removed so the people will click through to their website. First of all this normally means that your website is been hacked and probably is delivering malware. Many hackers do not want to delete or disturb your site they just want to trick your visitors into downloading some malicious software. Normally the malicious software will then download a virus or something of that nature so the hacker can gain access to your…Read More

Tags: General
Posted in General | Leave a comment

Great way to share your screen

Here is a great website to share your screen with other people remotely so they can see what you are doing. It is free and easy to use.
http://www.joinme.com

Tags: General
Posted in General | Leave a comment

Naming passwords and usernames that make sense

Okay, here’s the deal. Let’s talke about designers/developers who uses cute, fun, clever, and other strange types of words in passwords and usernames for their clients. For instance, I had an employee working for me and I asked him to create a new account login for a client of ours. He used devil69 for the password and when I found out I asked him why he used that. Of course he did not have a clue he just thought it was cool. I carefully explained to him that our clients probably think we are less than professional when we give them passwords like…Read More

Tags: General
Posted in General | Leave a comment

Copy files from one server to another – both remote servers

I have always been looking for an easy way to copy files from one server to another. Not local servers, but 2 remote servers. For instance, I want to copy the entire website from www.domain1.com over to www.domain2.com . Normally I download the website using an FTP program and then upload it to the other website using the same FTP program. Recently I found that ipswitch ftp professional lets me open up a remote server on the left and the remote server on the right. Then I can drag-and-drop files between them. I know there are ways to…Read More

Tags: General
Posted in General | Leave a comment

Adding a Youtube Video To Magento Page

This tutorial will show you how to add a youtube video to a magento cms page. You can also use the same technique for adding a youtube video to a product page in the products description area.

Step 1: Go to your magento admin panel at http://www.yourdomain.com/admin/

Step 2: In the main menu go to CMS then choose Pages from the drop down menu

Step 3: You can create a new page or edit an existing page by clicking on the name of that page in the list shown. I will assume that you are on the page you created and/or…Read More

Tags: Ecommerce & Shopping Carts
Posted in Ecommerce & Shopping Carts | 4 Comments

Get last entry of an array

Here is a nice way to grab the last item of an exploded string:
$my_string = ‘one-two-three-four’;
$last_item = end(explode( ‘-’, $my_string);
echo $last_item; // four

Tags: Php Programming
Posted in Php Programming | Leave a comment

Opening large .sql files

Sometimes I have a backup of a mysql database in an .sql file and when I open it in notepad or wordpad it takes forever and freezes most of the time. I recently figured out that I could open it in Microsoft Excel and not only did it open quickly but it was laid out in an easy to use way. I found the table I needed easily and was able to copy and paste the code into my mysql gui.

Tags: General
Posted in General | Leave a comment

Session not working

Sometimes I have a site where the session does not seem to work when I set something on one page and go to the next. The session is empty no matther what I try. For instance, on page 1 I do this: $_SESSION = ‘something’;

Then when I go to page 2 and do this echo $_SESSION I get nothing.

I have found that sometimes the solution is the session_save_path() setting. If I create a directory called tmp and then add something like this to my page right above the session_start() things start working:

session_save_path(‘/full/path/to/your/site/tmp’);

Tags: General
Posted in General | Leave a comment

Validate html and css

This one is much easier said than done sometimes. I have many sites that I’ve never even looked at through the validators but then there’s other sites that I have validated correctly. It always helps to validate your HTML and CSS and it makes the pages load faster. It also gets you better rankings on the search engines.
Validate your HTML here: http://validator.w3.org/
Validate your CSS here: http://jigsaw.w3.org/css-validator/

It’s also very important to have a doctype at the top of your HTML document. Here’s a recommended list of doctypes you can use:
http://www.w3.org/QA/2002/04/valid-dtd-list.html

If you’re editing your html in Dreamweaver then it will…Read More

Tags: Site Speed & Performance
Posted in Site Speed & Performance | Leave a comment