I wrote this
uses('Sanitize');
$dbconf=new DATABASE_CONFIG();
[EMAIL PROTECTED]($dbconf->default['host'],
$dbconf->default['login'], $dbconf->default['password'] );
@mysql_select_db($dbconf->default['database'], $mydb);
$sanit=new Sanitize();
$mylink=$sanit->sql(substr($_SERVER['QUERY_STRING'], 4));
[EMAIL PROTECTED]("select * from friendlylinks where
link='".$mylink."'", $mydb);
if($myres && mysql_numrows($myres)>0){
$mydata=mysql_fetch_assoc($myres);
$myroutedata=explode('/', $mydata['action']);
$routeparams=array();
$routeparams['controller']=$myroutedata[0];
$routeparams['action']=$myroutedata[1];
if(count($myroutedata)>2)
array_push($routeparams, $myroutedata[2]);
$Route->connect($mylink, $routeparams);
mysql_free_result($myres);
}
It's working. What do you think of this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---