PDA

View Full Version : php functions in xhtml



supermobi
04-08-2008, 05:08 PM
do php functions work differently on xhtml? I really dont understand why they would, since php is server side...
but I have a damn error that i can't figure out and when i try the same function on a normal html page, it works...

i'm passing a value to another page then the receiving page is supposed to filter the value through a function, and its not happening, the function runs, but doenst change the value.. and on html it does.. is the exact function, i copied and pasted it....

GijsZePa
04-08-2008, 05:16 PM
do php functions work differently on xhtml? I really dont understand why they would, since php is server side...
but I have a damn error that i can't figure out and when i try the same function on a normal html page, it works...

i'm passing a value to another page then the receiving page is supposed to filter the value through a function, and its not happening, the function runs, but doenst change the value.. and on html it does.. is the exact function, i copied and pasted it....

Sounds strange. What are you doing with that function exacly ? If the function write javascript to the browser you have a problem. If the function is only serverside it sounds strange to me..
XHTML is just static. It has no effect on your server scripting

Martin

supermobi
04-08-2008, 05:27 PM
Sounds strange. What are you doing with that function exacly ? If the function write javascript to the browser you have a problem. If the function is only serverside it sounds strange to me..
XHTML is just static. It has no effect on your server scripting

Martin
I know, its so weird. The function changes a letter with accents on a word and puts instead the html escape character.

Its a very simple function...

function toHtml($entra){
$traduce=array( 'á' => 'á' , 'é' => 'é' , 'í' => 'í' , 'ó' => 'ó' , 'ú' => 'ú' , 'ñ' => 'ñ', 'ü' => 'ü', 'Á' => 'Á', 'É' => 'É', 'Í' => 'Í', 'Ó' => 'Ó', 'Ú' => 'Ú', 'Ñ' => 'Ñ','¿' => '¿', '¡' => '¡' );
$sale=strtr( $entra , $traduce );
return $sale;
}
//call toHtml($variable);

Im lost man...