When you echo or print to the HTML stream, strings are delimited by " or '. Your case, return "<a onclick=\""+ocjs+"\", is correct JS but not PHP.
When you want to echo this in PHP you must echo it as return \"<a onclick=\\\"\"+ocjs+\\\\ in order to counter the strings being ended before time. More info: http://www.php.net/manual/en/language.types.string.php Another function you might want to look at is stripslashes(): http://www.php.net/manual/en/function.stripslashes.php --|-- Tino Didriksen http://ProjectJJ.dk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]