Login   Register  
PHP Classes

File: example4.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ersin Gven  >  SEO link factory class  >  example4.php  >  Download  
File: example4.php
Role: Example script
Content type: text/plain
Description: restore_all() example
Class: SEO link factory class
Retrieve friendly URLs from a database
Author: By
Last change: utf8 proble fixed.
Date: 6 years ago
Size: 1,551 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"; />
<title>Php_cat example</title>
    # http://developer.bloggum.com

    ## Mysql connection.....
$link mysql_connect("localhost","root","","seo_example") or die (mysql_error());
mysql_select_db("seo_example",$link) or die (mysql_error());
mysql_query("SET NAMES 'utf8'");

$seo seo::getInstance();
//set table
$seo->table = array('TABLE_NAME'=> 'articles',    //table name
'ID'=> 'article_id',  //table id field name
'FIELD'=> 'title',    //which field you want to convert.
'FIELD_LINK'=> 'link' //link field name

$seo->restore_all(); //renew all links..

        TITLE               LINK
    | &#287;._e&#287;&#351;08     | cgu-_egs08aqn
    | i See dead peoPle | i-see-dead-people
    | &#287;._e&#287;&#351;08     | cgu-_egs08aqn-1
    | &#287;._e&#287;&#351;08     | cgu-_egs08aqn-2
    | &#287;._e&#287;&#351;08     | cgu-_egs08aqn-3