PHP
  Home arrow PHP arrow Page 4 - Using PHP to Create Relevant Title Tags in osCommerce Websites
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Using PHP to Create Relevant Title Tags in osCommerce Websites
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 7
    2009-05-21


    Table of Contents:
  • Using PHP to Create Relevant Title Tags in osCommerce Websites
  • osCommerce Web Template Files and Page Title Naming
  • Proper Page Title Naming for the Home Page and Categories
  • Proper Page Title Naming for the Product Pages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using PHP to Create Relevant Title Tags in osCommerce Websites - Proper Page Title Naming for the Product Pages
    ( Page 4 of 4 )

    For the Product_info.php, the following is the recommended script:

    <?php

    $optimizedurl=$_SERVER["REQUEST_URI"];

    $location1=(strpos($optimizedurl,'products_id'));

    $start= $location1 + 12;

    $productidextracted=substr($optimizedurl,$start,2);

    $result = mysql_query("SELECT `products_name` FROM `products_description` WHERE `products_id`='$productidextracted'")

    or die(mysql_error());

    $row = mysql_fetch_array($result)

    or die("Invalid query: " . mysql_error());

    echo "<br />";

    $titletag = $row['products_name'];

    ?>

    <title><?php echo $titletag; ?></title>

    To implement the following recommendations, find this piece of code in the default affected templates:

    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

    <title><?php echo TITLE; ?></title>

    Replace it with the modified PHP script. For the product_info.php the above lines will now become:

    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

    <?php

    $optimizedurl=$_SERVER["REQUEST_URI"];

    $location1=(strpos($optimizedurl,'products_id'));

    $start= $location1 + 12;

    $productidextracted=substr($optimizedurl,$start,2);

    $result = mysql_query("SELECT `products_name` FROM `products_description` WHERE `products_id`='$productidextracted'")

    or die(mysql_error());

    $row = mysql_fetch_array($result)

    or die("Invalid query: " . mysql_error());

    echo "<br />";

    $titletag = $row['products_name'];

    ?>

    <title><?php echo $titletag; ?></title>

    To be truly effective, revise the title tag PHP script in all important templates such as index.php, product_info.php, and the main pages in a typical osCommerce website navigation menu.

    You can find more osCommerce tips and tricks here: http://www.php-developer.org/



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek