+ Almost all quality improvement comes via simplification of design, manufacturing... layout, processes, and procedures.

July 30, 2010, 5:04 pm

Redirect mobile users to a mobile friendly page with php

June 25, 2009

After allot of trial and error I ended up coming up with some code that will redirect users to a mobile friendly page, this method won’t really be useful in about 5 years because modern browsers like safari allow full page viewing but this will get you by until then. Remember this code will have to change constantly if you want to stay up to date with the latest hand held devices and mime types.

To get started all you have to do is place the following code in the stop of your php page. If your loading an application you can post this below your application just don’t output any data before the code is executed.


$mobile_browser = '0';if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i',
strtolower($_SERVER['HTTP_USER_AGENT']))){
$mobile_browser++;
}

if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or
((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))){
$mobile_browser++;
}

$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
'wapr','webc','winw','winw','xda','xda-');

if(in_array($mobile_ua,$mobile_agents)){
$mobile_browser++;
}
if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0) {
$mobile_browser++;
}
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0) {
$mobile_browser=0;
}

//change this to your mobile friendly page
if($mobile_browser>0){
header( "Location: http://www.yourwebsite.com/mobile/" ) ;
} else {
// do something else
}

$ua = $HTTP_USER_AGENT;
if (stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or stristr($ua,
"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68") or stristr($ua,
"Syncalot") or stristr($ua, "Blazer") or stristr($ua, "NetFront"))
{
$DEVICE_TYPE="MOBILE";
}

if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE")
{
//change this to your mobile friendly page
header( "Location: http://www.yourwebsite.com/mobile/" ) ;
exit;
}

?>

Posted by Anthony under PHP | Comments (2)

Added Pizza Builder to Online Ordering Application

March 22, 2009

A new feature has been implemented into the pizza builder application, you can now build your own pizza using the new feature. This process has been simplified for ease of use. The pizza builder application is completely configurable in the administration section of the website. The admin section allows you to add different types of pizza, assign sizes, names, prices, toppings and topping prices. This feature also gives the pizza owner complete details of what the customer ordered.

To view a demo of the pizza builder click here

Posted by Anthony under News, Online Food Ordering | Comments (0)

Online food ordering script “Restaurant Biller” released with pricing!

March 8, 2009

rest.png

  • Easy AJAX powered checkout system
  • Receive the orders directly through email within 30 seconds of placed order
  • Easy customization for those who want to modify their site
  • Set the hours you would like your store open
  • Turn your store off and on through the administration panel
  • Enable Credit or disable credit cards
  • Enable or disable delivery and delivery fees
  • Modify your home page directly from a control panel
  • Add Edit and delete categories to your menu
  • Add Edit and delete menu items with extented features
  • Each site has a contact us page for customer questions
  • Edit the hours you would like your online store open
  • Add an addition cost for delivery, tax prices or order processing fees
  • Built In newsletter system
  • Free updates

Click here for a demo

Posted by Anthony under AJAX, Online Food Ordering, PHP, Web Technology, mysql | Comments (0)

Cubecart Mass (bulk) price changer

January 6, 2009

This module will change the product prices of all products or the categories you select. You can pick add/subtract and choose if you would like to use addition/subtraction or percentage.

Features

  • Add or subtract an amount or percentage
  • Preview the changes before making any changes
  • Choose all products
  • Choose just a certain category
  • Complete product price updates painlessly and quick!

capture.JPG
Price: $10

Posted by Anthony under Cubecart | Comments (0)

Ajax Cubecart custom category order 2.0

December 19, 2008

Hi there, here’s a little Christmas present from me to cubecartforum.org community.

I thought I would make a new post for this considering this is a full rewrite of my original category ordering mod. This version uses ajax for all the work. All you have to do is type the position number into the text box and ajax takes care of the rest! Works in real time!

catsort.jpg

Click here to download: category sorting mod

Posted by Anthony under Cubecart | Comments (0)

PHP Function: Make non linked links clickable

December 16, 2008

Recently I came across a problem making a twitter plugin. I needed to make links which had no “a” tag into links. You can do this progamaticly and here is the solution:

If you are going to use this script please download from here: links.php.txt

Code (php)
  1. function makeClickableLinks($text) {
  2.  
  3. $text = eregi_replace(’(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)’,
  4.  
  5.     ’<a href="1">1</a>’, $text);
  6.  
  7.   $text = eregi_replace(’([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)’,
  8.  
  9.     ’1<a href="http://2">2</a>’, $text);
  10.  
  11.   $text = eregi_replace(’([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})’,
  12.  
  13.     ’<a href="mailto:1">1</a>’, $text);
  14.  
  15. return $text;
  16.  
  17. }
  18.  
  19. // Usage
  20.  
  21. // Email address example
  22.  
  23. $text = "you@example.com";
  24.  
  25. echo makeClickableLinks($text);
  26.  
  27. echo "
  28.  
  29. ";
  30.  
  31. // URL example
  32.  
  33. $text = "http://www.example.com";
  34.  
  35. echo makeClickableLinks($text);
  36.  
  37. echo "
  38.  
  39. ";
  40.  
  41. // FTP URL example
  42.  
  43. $text = "ftp://ftp.example.com";
  44.  
  45. echo makeClickableLinks($text);

Posted by Anthony under PHP | Comments (0)

Cubecart product compare mod

December 15, 2008

Cubecart product compare mod allows customers to compare 2 or more products, the customer can see the price,description, image, name and weight. The Cubecart product compare mod also makes it simple to add new fields to the compare mod. For instance if you own a computer shop you can add some custom fields to the inventory table and compare those items on the compare page by just drawing the variable. With a simple installation this mod is a sure win for your cubecart installation.

Price: $15
License: unlimited domain
Demo: http://worcesterwideweb.com/store/index.php?act=viewCat&catId=1

compare.jpg


Posted by Anthony under Cubecart, News, PHP | Comments (3)

Restaurant Online Ordering System Beta available!

December 7, 2008

The Restaurant Biller application is now available! With the features  listed below and the low price it costs to use this application its a sure hit for small business restaurants world wide. Here are the features the Restaurant Biller boasts:

The online restaurant ordering system for small to large businesses. More and more people are going online to search for food in their area rather then using the yellow pages. Restaurant Biller© created an online solution for those restaurants to have an online menu where customers can place orders. This application is very powerful and easy to use with features allowing you to easily control every aspect of your website. Listed below are some of the features included in this application.

  • Easy AJAX powered checkout system
  • Receive the orders directly through email within 30 seconds of placed order
  • Easy customization for those who want to modify their site
  • Modify your home page directly from a control panel
  • Add Edit and delete categories to your menu
  • Add Edit and delete menu items with extented features
  • Each site has a contact us page for customer questions
  • Edit the hours you would like your online store open
  • Add an addition cost for delivery, tax prices or order processing fees
  • Free updates

Click here to view the demo and website
or
Click here to enquire about getting setup on this system

Posted by Anthony under News, Online Food Ordering, PHP, Portfolio, Web Technology | Comments (0)

Cubecart Catalog mod available for CC4

December 7, 2008

The Cubecart Catalog mod is now available for Cubecart 4. This mod has exactly the same features seen in CC3 but just now supports the new file system. The mode is available for purchase here:


Posted by Anthony under Cubecart | Comments (0)

Restaurant Online Ordering System

September 29, 2008

I started development on a new exciting project, I will be making a restaurant ordering system. That will be simple to use and cost effective for local restaurants to use. Right now I am still developing this application and adding new features everyday. Some of the features the Restaurant Online Ordering system will be:

  • Template based system for easy ordering
  • Pay by credit card (with 3rd party processing of course)
  • Pay by paypal
  • Pay at store (pickup)
  • Administration panel for adding/editing/delete categories
  • Administration panel for adding/editing/deleting products
  • Secure online ordering using SSL
  • AJAX ordering system for faster loading
  • Built in page manager
  • Customer Order database
  • Print directly on printer (Order goes directly from website to printer within 1 minute) *PC in restaurant required

More features to come soon, check back soon.

Posted by Anthony under News, Online Food Ordering | Comments (0)

Next Page »