Login   Register  
PHP Classes
elePHPant
Icontem

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: 5 years ago
Size: 1,551 bytes
 

Contents

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">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"; />
<title>Php_cat example</title>
</head><body>
<?php
    
//!!!! PLEASE DOWNLOAD AGAIN ORIGINAL PACKAGE FROM BELOW THE URL ELSE YOU CAN'T SEE SOME UTF-8 CHARACTERS...
    # http://developer.bloggum.com
    /* RESTORE ALL DATA ON THE CURRENT TABLE  */

    ## 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'");

    require 
"seo.class.php";
    
$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..

    //OUTPUT
    /*
        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
    .
    .
    .
    */
?>
</body>
</html>