Create a .htaccess file and place in it your HTML root directory.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /profile.php?user=$1 [L]
The first line starts the Rewrite Engine.
The 2nd line checks to see if that first paramater is not an actual directory such as /images.
The 3rd line get's the name <http://www.mysite.com/peterpan> and points it to <http://www.mysite.com/profile.php?user=peterpan>. Your PHP script would then search the database for a user with that name and show the profile.
Hope it helps.
best,
Cent