Sessions must be used before ANYTHING is output to the browser. Put:
<?
include(".\include\connectTonedb.inc");
$sql = "Select * From referral where ref_id=$GvaUSER and ref_pwd='$GvaPWD'";
$rows = mysql_query( $sql );
if (!$rows)
echo "Login Error!!";
else {
session_save_path("session_data");
session_start();
session_register("refid");
$refid = $GvaUSER;
}
?>
At the very top of your page, before anything else, and you shouldn't have a problem. Also, try to stray away form using the <? opening tag, get used to <?php, as just <? may have conflicts in the future with X(HT)ML.
-Andy