PHP Classes
Icontem

File: example1.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ersin Güvenç  >  SEO link factory class  >  example1.php  
File: example1.php
Role: Example script
Content type: text/plain
Description: insert example
Class: SEO link factory class
Retrieve friendly URLs from a database
 

Contents

Class file image Download
<?php
/*
    //!!!! PLEASE DOWNLOAD AGAIN ORIGINAL PACKAGE FROM BELOW THE URL ELSE YOU CAN'T SEE SOME UTF-8 CHARACTERS...
    # http://developer.bloggum.com
    PLEASE FIRST OF ALL set your seo $replace_with_character in seo.class.php
    BECAUSE THIS CHARACTER STATIC !
    default $replace_with_character  "-";
    you can set any character like "__" ,"space", "~~" etc...
*/
    ## 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
                        
);

    
$title "ç&#287;ü._e&#287;&#351;08ÀØñ";      //$title coming from $_POST variable..
    
$link $seo->insert($title);
    echo 
$link;  //---->> USE THIS LINK WITH YOUR MYSQL INSERT OPERATIONS..

    //forexample
    
mysql_query("INSERT INTO articles VALUES('','','','$link')") or die(mysql_error());
    
//refresh page and see..



?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products