Written: November 7, 2011

The Subtleties of PHP and WordPress Development

I like to keep my WordPress sites up to date with the latest release of software so when I finally upgraded this site to WordPress v3.2.1 I noticed something quite odd. The site would load and operate OK however when I tried to login I saw the familiar login screen:

WordPress login

 

Clicking Log In brought me to a blank screen. Hmm. After several hours of Google search and trying several dead ends I finally read about the functions.php file and looked for empty spaces after:

<?php
php?>

Sure enough, in the middle of my functions.php file I had some blank spaces. Removing those blank spaces brought my WordPress login back to life.

Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Avoid Yahoo Small Business for Web Hosting

avoid yahoo small business for web hosting
Unfortunately I do have a client that started with Yahoo Small Business for his web hosting and we have been using WordPress so that he can make his own updates.

The issue we have now run up against is that WordPress 3.2.1 requires PHP 5 and MySQL 5 to work. Yahoo is only half-way there on supporting this because PHP 5 is allowed while MySQL 5 is not yet supported. So we are stuck using an old version of WordPress which makes our site susceptible to hacking, not something that you want to risk when running a business and depending on your web site to always be up and running.

WordPress

When you search other blogs about this the reply is uniform, “Yahoo Small Business” is far behind the times and will not commit to a date for supporting the most popular blogging and web CMS platform in the world.

Sad, but true. You have been warned.

I recommend hosting with 1and1 instead, they are up with the times, support the latest WordPress, have excellent up-time, the control panel is intuitive and real people answer the phone to support you.

1and1 has great web hosting for WordPress

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Speeding Event Registration with Auto Fill

PPI is a client that organizes several annual events with online registration. Jules at PPI asked me to look into automating the process for companies that are returning again this year so they don’t have to re-type so much information again.

I did some searching on Google and found a solution that uses jQuery, then another site that showed how to integrate that with a MySQL database.

Here’s what the visitor sees when they register:

speeding event regisration

As they type in their company name like “canon” they see a list of possible matches:

They click the matched name “Canon” and the next 8 fields are auto-filled:

Coding

Adding this new feature required that I add jQuery and CSS in the HEAD of my page and define which fields should be auto-filled:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css">   

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {

   
    $("#company").autocomplete({
        source: "test_company.php",
        minLength: 2,
        select: function(event, ui) {
            $('#address').val(ui.item.address);
            $('#city').val(ui.item.city);
            $('#state').val(ui.item.state);
            $('#zip').val(ui.item.zip);
            $('#phone').val(ui.item.phone);
            $('#email').val(ui.item.email);
            $('#first_name').val(ui.item.first_name);
            $('#last_name').val(ui.item.last_name);
           
        }
    });
   
});


</script>

On line 9 I used #company as the name of the input field where a visitor types the company name.

The connection to the database with all of the company info stored is defined on line 10 as “test_company.php”.

Lines 13 thru 20 have the eight field names that I want to auto fill in my form.

The HTML for each field uses the same ID just defined in the Javascript listed above:

1
2
3
<input name="company" type="text" id="company" />
<input name="first_name" type="text" id="first_name" />
...

The connection to the MySQL database is defined in the file “test_company.php”:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?
/* Connection to the database. */
include 'database.php';

$return_arr = array();

/* If connection to database, run sql statement. */
$fetch = mysql_query("SELECT * FROM ppigolf WHERE company LIKE '%" . mysql_real_escape_string($_GET['term']) . "%'");

/* Retrieve and store in array the results of the query.*/
while ($row = mysql_fetch_array($fetch) ) {
    $row_array['address'] = $row['address'];
    $row_array['city'] = $row['city'];
    $row_array['state'] = $row['state'];
    $row_array['zip'] = $row['zip'];
    $row_array['phone'] = $row['phone'];
    $row_array['email'] = $row['email'];
    $row_array['first_name'] = $row['first_name'];
    $row_array['last_name'] = $row['last_name'];
    $row_array['value'] = $row['company'];

    array_push($return_arr,$row_array);
}

/* Free connection resources. */
mysql_close();

/* Toss back results as json encoded array. */
echo json_encode($return_arr);
?>

Line 20 is where I define that “company” is the ID being typed by the web visitor and is requires the array key of “value”. For simplicity I named my form fields the same as my database table fields.

Enjoy automating your registration forms and using auto-fill to speed up the process.

Tags: , , , ,

5 responses to “Speeding Event Registration with Auto Fill”

  1. Chiusuzaki Hime says:

    Could you please upload your code? I really need this code in my project .

    • Daniel Payne says:

      The code is already posted in the blog. Are you a developer or just a web user? This code is meant for someone that knows how to program with: jQuery, CSS, HTML, PHP and MySQL.

      • Chiusuzaki Hime says:

        I’m a developer, a beginner . I try to run your code after adjusting several places (where necessary) but I couldn’t get the same result as posted here .

  2. Daniel Payne says:

    I’m available for hire at $75.00/hour to make this work on your web site. Are you using any CMS like WordPress, Drupal, Joomla, etc.?

Leave a Reply

Your email address will not be published. Required fields are marked *

How I Migrated my Custom PHP Site to WordPress

Since most of my web clients are now using WordPress it was only logical to migrate my own site from a custom PHP implementation to a custom WordPress site. Here are the steps that I followed:

1) Decided on a new look for my site by making a Home page mock-up in Photoshop
2) Created a static HTML index.html page for my new Home page
3) Created a custom WordPress theme by dividing my index.html page into PHP, CSS and Javascript files

WordPress PHP files

4) Add my favorite plugins

My favorite plugins

5) Imported my blog from www.blogger.com

6) Tested and went live

If you’re curious about the details drop me an email or leave a comment. This migration took me about 10 hours to complete and now I can update my new site using only a web browser instead of using Dreamweaver.

Of course I still use Dreamweaver, Photoshop and WordPress every day now to deliver customized features, pages, WordPress themes and WordPress plugins.

Tags: , , ,

6 responses to “How I Migrated my Custom PHP Site to WordPress”

  1. snehal says:

    I would like to know the detailed process of migrating my php website to wordpress. My wordpress directly lies in website’s directory.

  2. Daniel Payne says:

    Good morning. If you are handy with HTML, CSS and Javascript you can re-use the look of your current PHP site and create a Custom Template in WordPress. Otherwise you have a few choices:

    1) Use an existing WordPress Theme.
    2) Hire someone to create a custom WordPress Theme
    3) Learn how to code your own custom theme in WordPress

    How much content do you have to migrate from your PHP site to WordPress? Is it a handful of pages, hundreds of pages or thousands of pages?

    Here’s some WordPress documentation on creating a new theme: http://codex.wordpress.org/Theme_Development

    If time is of the essence, then hire a WordPress developer like me to get the job done quickly and correctly.

  3. Daniel says:

    Hello,

    How did you migrate the content off the database and import it into WordPress? My client has thousands of pages I need a little help.

    Thank you

  4. Shilpa says:

    Hello,

    Could you please let me know how you transferred the custom PHP website to wordpress with same domain name? I am having issues with maintaining the same domain name and also a part where the database needs to be taken care of.

    Please let me know,
    Thank you

    • Daniel Payne says:

      Shilpa,

      You can install WordPress on your existing domain in a folder like /new, then write a PHP script to read your old content and create new WordPress pages or posts.

      You can always hire me at $75/hour to perform this service, or give it a try yourself.

      Good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *

Dascom Systems, Client Exmaple

Over the past few months I’ve been contracting with Pivot Group on a site for Dascom Systems.

Dascom Systems

We just launched on Friday and I’m excited to show you what our team accomplished:

WordPress is a very popular blogging and CMS plaform and most people just find a theme and use it. For this client we had a talented designer named Drew Dunn provide all of the beautiful page layout and Flash animations.

This design was created from scratch using Dreamweaver, Photoshop, CSS and Javascript, then turned into a WordPress theme.
FancyBox was used to show larger photos when you click on a thumbnail:

The CEO of Dascom sent us a thank you email, which felt just wonderful to read:

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Tethered Photography,Applescript, PHP, MySQL and Web Servers

I’m getting ready to do formal portraits at a corporate party in March so I’d like to share with you how I’ve automated my workflow to better serve clients. Here are my work flow objectives:

  1. Allow clients to be photographed, see proofs and order in a few minutes.
  2. Minimize any waiting in lines.
  3. Have fun, create lasting memories.

To achieve these objectives I’ve assembled the following technologies:

Here’s how the computers and camera are all connected:

I’m a geeky guy so I wrote my own Applescript to re-size and copy images, plus the proofing and order system was written with PHP, MySQL, Javascript, Dreamweaver and Photoshop.

My web server on the PC is using the popular XAMPP tools, which are Open Source.

Shooting
I operate my Canon 5D just like always, on full manual with custom white balance, everything metered so there are no surprises. Using the USB2.0 cable it takes about 6 seconds for an image to go from the camera to the iMac. I shoot JPEG for event photos to save time and they look just great. 

Applescript
This script takes about 5 seconds to re-size the full-size image into a proof and thumbnail size images, then copies them over to a folder on the PC where the web server is running.

Proofing and Ordering
The client uses a web browser to see their proofs. At first they see thumbnails. Clicking a thumbnail brings up a larger image with a price list.

 
 

Post Event
When I arrive back home after the event, then I run another web page to take my batch credit card orders and process them. Yes, I wrote that one too.

Summary
I’ve been able to achieve my event photography work flow objectives by using some standard technology and some custom technology to get the job done. My clients can be photographed, proof and order in a few minutes. They’re happy and I’m busy sending orders to my lab and then delivering prints to clients.

Tags: , , , , , , , , ,

One response to “Tethered Photography,Applescript, PHP, MySQL and Web Servers”

  1. Chris Roane says:

    Hi,

    I love the article and your blog. Would you be interested in exchanging links with me? My website is http://www.montanaprogrammer.com/ . Please let me know!

Leave a Reply

Your email address will not be published. Required fields are marked *

Tualatin Chamber – A New Look

Linda, CEO of the Tualatin Chamber contacted me recently about sprucing up their web site with a new look. She liked the colors light blue and navy blue, and wanted to see more variety visually. Here’s what I changed:

  1. Replaced the static banner with a dynamic one. Each page click brings you one of six different photo banners. Reduced the height from 200 pixels to 150 pixels, leaving more room for content. 
  2. Navy blue – replaced the old menu with this new color scheme. Navy blue menu, light blue diamonds at top, white text, red selected text.
  3. Right column – replaced the white background with a light blue background. Changed most of the fonts to white with a black hover color.

This site uses my custom Content Management System, which provides an easy way to update content, add events, manage members, accept payments, send emails, display banner ads and allow members to update their own profile or add events, jobs and special offers.

Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Sherwood Chamber of Commerce, Site Remodel

I had the pleasure of launching a new client site this week for the Sherwood Chamber of Commerce:

Features on the site include:
Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

New Site for Author, Roland Smith

I’ve really enjoyed working with Roland Smith over the past several years to keep his web site humming, Social Media growing, and newsletters sending. He decided it was time for a new look so we started adding elements that he envisioned:


Enjoy your visit to his site and maybe you’ll want to read one of his many adventure books.

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Adding a Twitter Feed with PHP

At my marketing web site www.marketingeda.com I wanted to add a Twitter feed using PHP and found something at twitter.slawcup.com/twitter.class.phps that does just that.

The PHP coding is very simple to use with this class:

include_once(‘classes/class.twitter.php’);

$t = new twitter;
$t->username = ‘marketingeda’;
$t->password = ‘********’;

$data = $t->userTimeline();

foreach($data as $tweet) {
print “<li>$tweet->text</li>
“;
}

Here’s the output result of this PHP script:

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts

Blog Tags

Blog Directory & Business Pages at OnToplist.com