Login   Register  
PHP Classes

File: example1.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  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: insert example
Class: SEO link factory class
Retrieve friendly URLs from a database
Author: By
Last change: table fields changed.
Date: 6 years ago
Size: 1,355 bytes


Class file image Download
    # http://developer.bloggum.com
    PLEASE FIRST OF ALL set your seo $replace_with_character in seo.class.php
    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'");


$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);

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