This topic is locked

Function to change upload names

2/18/2009 3:15:10 PM
PHPRunner General questions
A
alfonso authorDevClub member

I want to change specials characters of upload name of files with á é,... and I have a function but I don't know where to put it:
function QuitaAcentos($cadena){

$p = array('á','é','í','ó','ú','Á','É','Í','Ó','Ú');

$r = array('a','e','i','o','u','A','E','I','O','U');

$cadena = str_replace($p, $r, $cadena); //Reemplazamos acentos

$cadena = $cadena(trim($cadena));//Quitamos espacios, antes y después

$cadena = eregreplace(' +','',$cadena);//Quitamos espacios entre medias y sust por "-"

return $cadena

}
where $cadena is a variable with the name of the file
Can anybody help me? Thanks

J
Jane 2/19/2009

Hi,
edit generated ..._edit.php/..._add.php files manually for this purpose.

Find and modify this code:

$value = postvalue("value_FieldName");

$type=postvalue("type_FieldName");

...

A
alfonso authorDevClub member 2/19/2009

I found this code but I don't know what must I do then

A
alfonso authorDevClub member 2/22/2009

I found this code but I don't know what must I do then


Can you help me then? Where must I put code?