OK a few things to comment about
SESSIONS, never store information such as passwords, credit cards or anything like that in a session. You have stored the password. This also goes for Cookies as well..
No encrypted password or hashed. Your storing your passwords as raw text meaning there is no checking error checking other than the fact its been checked by the database. Try using md5() to hash the password so it cannot be easily cracked.
Error Checking you have an SQL Injection attack waiting. Before any data goes into a database or anywhere really the data must be validated. Id check using addslashes(), htmlentites(). You may want to search on other methods how people check data.
One more thing use <?php instead of <? when you want to start using XML with PHP your going to end up with problems also some hosts have short_tags off.
$login_check = mysql_num_rows($sql);
$userid = mysql_result($sql,0,"userid");
if($login_check > 0){
Why not make it easy on yourself and PHP
if (($check=mysql_num_rows($sql))=="1") {
$userid = mysql_result($sql,0,"userid"); //you called this before there was actually a result.
}
Also instead of using mysql_result all the time why not use mysql_fetch_array it will probably speed the script up slightly as your not calling MySQL all the time.