I haven't personally used myspace (thank god) but I believe what you are talking about is a sort of BB code system. The information (be it code or whatever) that is inserted into the textbox is being parsed (and looked through) either on submission, or when the page is rendered adn then changing its contents by replacing what the program recognizes with what it is told to replace with.
Take this case for example. You have some BB to make text bold this is done with
CODE
[b]Bold Text[/b]
The server (backend) looks at the stuff and says something to the effect of "Oh, hey look there is a
[ b] tag. I am supposed to change that out with a
<b> tag. Okay I did that any more?" And will go through as much as is fed to it and look for the various things to replace.
The replace is commonly done with preg_replace (a php function) and can look like so:
CODE
$string_given = "[b]Bold Text[/b]";
$output = preg_replace("|\[b\](.*?)\[\/b\]|i", "<b>$1</b>", $string_given);
And would output something looking like so:
Bold TextI believe that the same system (or at least type of thing) is going on behind the scene at myspace and other social networking sites. They are just replacing some code bits with more things. Like so:
CODE
$skin_array = array("<style>body{whatever} etc.</style>", "More styles", "and more styles", "and so on");
$string_given = "Look a different skin: <[Skin_0]>";
$output = preg_replace("|\[<\[Skin_(.*?)\]\>|i", $skin_array[$1], $string_given);
Which would output:
QUOTE
Look a new skin: <style>body{whatever} etc.</style>
Everything is also kept in a mysql (orother) database to make it easy to find and use again
Hopefully that was able to help you, or at least touched a bit upon what you were asking.
NOTE - I didn't test the code, so it may not work.
This post has been edited by BetaWar: 16 Jun, 2008 - 01:10 AM