PHP Classes

File: example4.php

Recommend this page to a friend!
  Classes of Ersin Güvenç   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: 15 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>