Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Monday, August 31, 2015

How to Detect Mobile Browsers (11 Steps)


Download the 'Detect Mobile User Agents & Browsers' PHP script by clicking on the link located in the 'Resources' section below. The downloaded file is compressed. Double-click on it to open your default extraction program and extract the files to your desktop.
Open an FTP (File Transfer Protocol) program and log in to your website's hosting account by typing in your FTP address, username, and password. Once you have connected to your hosting server, use the FTP program to upload the 'mobile_device_detect.php' file that you extracted in step 1. Upload it to the root directory of your website where your 'index.html' or 'index.php' file resides.
Use the FTP program to download the 'index.html' or 'index.php' file from your website and save it on your desktop. Open the file in a text editor such as Notepad or Wordpad.
Open a web browser and type 'http://detectmobilebrowsers.mobi/" into the address bar, then press the ENTER key. Alternately, you can click the 'Detect Mobile Browsers Website' link in the 'Resources' section below.
Scroll down to the 'Function Generator' heading. Here we will generate a PHP function code that will define how the PHP code file we uploaded in step 2 will behave. Choose an option from the respective drop-down menus for 'Detect iPhones,' 'Detect iPads,' 'Detect Android Devices,' 'Detect Opera Browsers,' 'Detect Blackberry Devices,' 'Detect Palm Mobiles' and 'Detect Windows Mobile Devices'. Each drop-down menu will allow you to specify whether to treat the device browser like a mobile browser or a standard desktop browser. You may also choose to redirect a device type to a custom URL, which must be typed into the text field that appears below the drop-down menu when you choose the 'Redirect (device) to a specific URL' option.
Choose an option from the 'Redirect Mobile Browsers' drop-down menu. Any devices that were set in the above options to be treated like a mobile browser will be affected by this option. You can redirect mobile users to a custom URL where there is a mobile browser-optimized version of your website or choose not to redirect them, which will allow them to access the standard website. Type the mobile-optimized website URL into the provided text box.
Set the 'Redirect Desktop Browsers' drop-down menu to 'No - Do not redirect desktop visitors - function will return false' to allow desktop browser users to access the standard website. Any devices that were set in the above options to be treated like desktop browsers will be affected by this option.
Click the 'Generate Code' button. Highlight the text that appears in the 'PHP Code' box and press CTRL+C on your keyboard to copy the text to your clipboard. Minimize your web browser so you can see the 'index.html' or 'index.php' file you opened in the text editor in step 3.
Create a blank line at the beginning of the text document by clicking your mouse at the top of the document and pressing the ENTER key. Place your cursor on the blank line and type '
' and press ENTER again.
Click on the 'File' menu at the top of the text editor and choose 'Save'. In the FTP program window, copy the edited 'index.html' or 'index.php' file back to the root directory of your website, overwriting the original file.
Access your website from a mobile device browser. You should be redirected to you mobile-optimized website. Access your website from a standard browser to make sure that you are directed to the standard website.
VPS Hosting

Saturday, August 22, 2015

How to Create a Multipage Website


Decide what pages your website should actually have. Starting out with a plan will save plenty of time later. For example, a basic website might consist of three pages: a homepage, an 'About' page, and a photo gallery.
Open a text editor such as Notepad (in Windows) or TextEdit (on a Mac) and create a new file for each page you plan on including. When saving each file, make sure to save them with a '.html' extension, and name your homepage 'index.' So using the above example, you would create three pages: 'index.html,' 'about.html,' and 'gallery.html.'
Think of a domain name ('example.com') to name your site. Come up with something easy to remember, as brief as possible, and spelled correctly.
Sign up for a web hosting plan. Since this is a very basic site, you won't need to pay for anything fancy, and in fact you can get a hosting plan for free from sites such as FreeHostia (see Resources). When signing up, you'll be able to register your domain name, which should cost about $10 for a year.
Log into the hosting control panel that your web host provided you after you signed up. Inside, there should be a 'File Manager' section. Open it, and look for a folder either named 'public_html' or named after your domain. Upload all your HTML files inside it.
Open a new browser window and type in your domain name in the address bar. The page that's automatically displayed will be 'index.html,' and you can reach your other pages by going to example.com/about.html, example.com/gallery.html, and so on.Of course, unless you've added something to each page, they're blank. To actually fill your pages with content, you'll need to write some HTML code, which is the basic language of the web and very easy to learn (see Resources for free HTML tutorials).
VPS Hosting

Friday, August 21, 2015

How to Create Custom Error Pages


Create your custom error page. Your custom error page can be whatever you'd like it to be -- funny, whimsical or apologetic. Create the 404 page in HTML and/or CSS code or use website design software like Adobe's Dreamweaver or Microsoft's Expression Studio.
Save your new error page as '404.html'. Save it into a folder or area on your computer where you can find it later to upload it to your website.
Log in to your hosting site and locate the .htaccess file. It should be in the main directory of your website, i.e., 'http://www.yourwebsitename.com/.htaccess."
Download the .htaccess file onto the computer or open it if your website has editing capabilities. If you downloaded it onto the computer, open it in a word processing program like Notepad.
Add the line 'ErrorDocument 404 http://www.yourwebsitename.com/404.html" to the document.
Save the .htaccess file and upload it back to your site (if downloaded).
Upload your '404.html' webpage to your domain, keeping it in the main directory of your site, e.g., 'http://www.yourwebsitename.com/404.html."
VPS Hosting