This blog site is not meant to be any information that is distributed to the general public. It is to serve as shared documentation between the DNSTC developers; however, if you find something useful and would like to use it, go right ahead.

Tuesday, January 31, 2012

Redirecting the Browser to a Mobile Web Page

imageIn this day in age, most web visitors are now coming from cell phones or mobile devices.  You need to have a version of your website that is designed for mobile devices.  One of the major issues with this is having the ability to detect if the browser is a mobile device.  There are hundreds of different browsers out on mobile devices right now, so I found the following website to help with this:

http://detectmobilebrowsers.com/

This site has the open source code you can use to add to your main webpage.  If the webpage detects it is a mobile device, it will automatically redirect to the mobile version of the page.

The following is the .PHP example of this:

Resizing the Web Page to Fit the Cell Phone Screen

imageOne of the issues we ran into when we started creating webpages for mobile devices was to have the screen auto-zoom so that the visitor did not have to take the extra step to zoom in on the content.

After several searches on the Internet, I came across the following code that you add as a meta tag to solve the problem.  We actually tested this on 4 different mobile browsers and it seemed to work just fine.

<meta name="viewport" content="width=device-width; initial-scale=1.0">

What this code does is resize the screen to the scale of the cell phone (or mobile device) browser.


That’s it.

Saturday, January 28, 2012

Reading a Textarea Field Into Separate Lines

imageOn occasion, you may run into the need to create a small utility the will read each line of a textarea field and process each line separately.  I have done this on a few occasions (like the domain upload for YourPopLinks.com or the Quick Task function on DNSTCcontact.com). 

Here is the code:

1.  You setup a field in your form that is a textarea, let’s call it dataList.

2. On the processing side, you would use the following code:


$dataList = trim($_POST['dataList']);
$dataProcess = explode("\n", $dataList);

foreach ($dataProcess as $line) {

$cleanData = trim($line);

...
process $cleanData
...

}


 


The first trim will remove the carriage return bit at the end of the data, the second trim within the foreach loop, will remove the carriage return at the end of each line.  I have seen examples of this where it used the second trim above, but it does not leave the ability to split the data into the $dataProcess array.


That is pretty much how you do that.  Works pretty good.

Thursday, January 26, 2012

Garbage Characters Being Displayed from Blog Posts

imageThe following describes an issue that we had with pulling RSS feeds from WordPress and displaying them on web pages and how we resolved the problem.  The main issue was that some characters where being displayed as garbage on the screen.  It took many months of research and testing out different things to get this issue resolved.

 

Problem

The main issue lied within the character encoding of the page where there information was being displayed.  The information coming from WordPress and the RSS feed was encoded with UTF-8 which allows for more than 128 ASCII characters; whereas, the HTML page it was being display on was encoded with iso-8859-1.

Solution

Change the encoding on the HTML page to UTF-8.  This fixes the issue and clears up all of the garbage characters.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Additional Resources


http://en.wikipedia.org/wiki/UTF-8


http://phpplanet.org/stop-junk-characters-%E2%80%98aetm%E2%80%99-from-appearing-instead-of-an-apostrophe/

Sunday, January 22, 2012

Server Cut Over Update

imageAfter several days (15 days) of moving over accounts, checking for errors, fixing issues, changing password, and so on, we are down to 4 more domains left to complete the move to the new server.  So far, everything has been working out great and the new server is working better than expected.   If you have not heard from DNSTC directly, then you site is probably already on the new server. 

You can check by sending a ping request to your domain and it should be pointing to 74.219.116.125 instead of 74.219.116.123.

This has not been a stress free project, but one that needed done desperately.  In the past 10 days, the old server has locked up about 20 times and it is slowly dying.

We got a great 7 years out of that server and billions of packets of traffic.  It will be sadly missed; however, it will under go some slight surgery and will reappear as a gaming server in a week or so after everything has been moved over.  I will post another update once everything is moved.

Server Cut Over Update

After several days (15 days) of moving over accounts, checking for errors, fixing issues, changing password, and so on, we are down to 4 more domains left to complete the move to the new server.  So far, everything has been working out great and the new server is working better than expected.   If you have not heard from DNSTC directly, then you site is probably already on the new server. 

You can check by sending a ping request to your domain and it should be pointing to 74.219.116.125 instead of 74.219.116.123.

This has not been a stress free project, but one that needed done desperately.  In the past 10 days, the old server has locked up about 20 times and it is slowly dying.

We got a great 7 years out of that server and billions of packets of traffic.  It will be sadly missed; however, it will under go some slight surgery and will reappear as a gaming server in a week or so after everything has been moved over.  I will post another update once everything is moved.

Tuesday, January 10, 2012

Server Migration Under Way

imageWe are currently in the process of migrating over to the new server for website and e-mail hosting.  So far the project has been going along fantastically.  We need to get all sites moved as soon as possible do to a temporary hosting license.  If DNSTC does not maintain your domain registration, we will be in contact with you for the new server's settings.