Well, you've got two ways you could do this. You can either make a PHP script that, when you upload a file, will physically edit the .ram file, or you could make a PHP script output a RAM file.
The latter is easier, but more server intensive. Either way, it's got the same basic logic.
If you want a PHP script to output the RAM, you can use either header('Content-type: audio/x-pn-realaudio') or header('Content-type: audio/vnd.rn-realaudio'), whichever floats your boat.
When constructing the RAM, you need to fetch each file you want to be in it--I'm sure you already know the extensions you want supported.
You can fetch each file in a directory using [man]readdir/man--here's the example from the manual:
if ($handle = opendir('/path/to/files')) {
echo "Directory handle: $handle\n";
echo "Files:\n";
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
}
You can use this in conjunction with [man]mime_content_type/man if you have Mime Magic, or [man]substr/man to get the filetype.
When you've got it listing all the correct files, just output them in the form that the RAM is expecting--if they are local, use file:///path/to/file.ra. If they are on and httpd, use http://www.path.to/file.rm. If it's streamed via rtsp, use rtsp://path.to/file.ra. For more info, consult the Real documentation.
If you need to pass meta data (extra stuff), just pass it via GET:
http://www.path.to/file.rm?title=title&author=j00
Hope that helps.