I try to fetch my users information using the getUser() function with a php script located in a iframe (wrapper) of Joomla. It seems there is problem passing parameters to ifram
Of course, the page that includes the iframe doesn't "know" Joomla - it's a different environment!
If I understood correctly what you're trying to achieve, then you really should create an article in Joomla that displays the user information, but instead of getting the user-id from:
$user = JFactory::getUser();
you should send it as POST/GET parameter from the OUTER page (you can add some kind of auth-string if security matters to you). The article will read this POST/GET parameter and display the user's information respectively.
The OUTER page (the one that contains the iframe) should refresh the iframe and use, as a url, the same url that displays the article (make sure it has "public" permissions) but will also send the user-id as parameter, for example:
iframe src="http://?id=articleId&userId=
hope it helps!