I inserted the code were you told me to SilvaTungDevil but now it is giving this error "Parse error: syntax error, unexpected ':' in /home/content/84/7099684/html/viewuser.php on line 107"
I have included the code from line 90 - 116.
Last Action: $str
Last Login: $str2
Online: $on
Days Old: {$r['daysold']}
Location: {$r['cityname']}</td><td>
Money: {$fm}
Crystals: {$r['crystals']}
Property: {$r['hNAME']}
Referals: ";
$rr=$db->query("SELECT * FROM referals WHERE refREFER={$r['userid']}");
print $db->num_rows($rr);
print"
Marital Status: ";
if ($r['marriage'])
{
$part=$db->query("SELECT * FROM users WHERE userid={$r['marriage']}");
$pr=$db->fetch_row($part);
print "Married to {$pr['username']}";
}
else
{
print "Single";
}
print "
";
Friends: {$r['friend_count']}
Enemies: {$r['enemy_count']}
</td> <td>";
And here is the code from marriage.php ... Again the error message that I get is "Warning: session_start() [function. session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/84/7099684/html/marriage.php:2) in /home/content/84/7099684/html/globals.php on line 6"
<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Marriage</font><hr width=75%>";
switch($_GET['action'])
{
case 'propose':
propose_marriage();
break;
case 'note':
send_note();
break;
case 'divorce':
divorce_marriage();
break;
case 'confirm':
divorce_confirm();
break;
case 'accept':
accept_proposal();
break;
case 'decline':
decline_proposal();
break;
default:
marriage_index();
break;
}
function marriage_index()
{
global $ir,$c,$userid, $db;
print "<center>
Welcome to the marriage office! What would you like to do today?
";
if (!$ir['marriage'])
{
print "> Propose marriage
";
}
else
{
print "> Divorce partner
//> Send Bouquet of Roses ($10,000)
> Send a love note
";
}
print "
<hr width=75%>> Back<hr width=75%>";
}
function propose_marriage()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
if(!$_POST['ID'])
{
print "
<form action='marriage.php?action=propose' method='post'>
Please type the ID# of the user you wish to propose to below.
ID: <input type='text' name='ID' value='{$_GET['ID']}' maxlength='10' length='10' size='10' width='10' />
<input type='submit' value='Propose' />
</form>
<hr width=75%>> Back<hr width=75%>";
}
else if($ir['marriage'])
{
print "
You are already married.
<hr width=75%>> Back<hr width=75%>";
}
else if($_POST['ID'] == $userid)
{
print "
You cannot propose to yourself!
<hr width=75%>> Back<hr width=75%>";
}
else
{
$db->query("INSERT INTO proposals VALUES ('', '$userid', '{$_POST['ID']}')", $c);
$q=$db->query("SELECT * FROM proposals WHERE prFROM=$userid");
$r=$db->fetch_row($q);
event_add($_POST['ID'], "{$ir['username']} would like to marry you:
Accept
Decline", $c,'general');
print "
Proposal sent!
<hr width=75%>> Back<hr width=75%>";
}
}
function accept_proposal()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$q=$db->query("SELECT * FROM proposals WHERE prID={$_GET['ID']}");
$r=$db->fetch_row($q);
if(!$_GET['ID'])
{
print "
Invalid proposal ID!
<hr width=75%>> Back<hr width=75%>";
}
else if($r['prUSER'] != $userid)
{
print "
You cannot accept this proposal!
<hr width=75%>> Back<hr width=75%>";
}
else
{
$q=$db->query("SELECT * FROM proposals WHERE prUSER=$userid");
$r=$db->fetch_row($q);
event_add($r['prFROM'], "{$ir['username']} has accepted your proposal!", $c);
$db->query("UPDATE users SET marriage={$r['prFROM']} WHERE userid=$userid");
$db->query("UPDATE users SET marriage=$userid WHERE userid={$r['prFROM']}");
$db->query("DELETE FROM proposals WHERE prID={$_GET['ID']}");
print "
Proposal accepted!
<hr width=75%>> Back<hr width=75%>";
}
}
function decline_proposal()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$q=$db->query("SELECT * FROM proposals WHERE prID={$_GET['ID']}");
$r=$db->fetch_row($q);
if(!$_GET['ID'])
{
print "
Invalid proposal ID!
<hr width=75%>> Back<hr width=75%>";
}
else if($r['prUSER'] != $userid)
{
print "
You cannot decline this proposal!
<hr width=75%>> Back<hr width=75%>";
}
else
{
$q=$db->query("SELECT * FROM proposals WHERE prID={$_GET['ID']}");
$r=$db->fetch_row($q);
event_add($r['prFROM'], "{$ir['username']} has declined your proposal.", $c);
$db->query("DELETE FROM proposals WHERE prID={$_GET['ID']}");
print "
Proposal declined!
<hr width=75%>> Back<hr width=75%>";
}
}
function divorce_marriage()
{
global $db,$ir,$c,$userid,$h;
if ($ir['marriage'])
{
print "
Are you sure you wish to divorce your partner?
<hr width=75%><table width=75%><tr><td width=50% align='center'>> No</td><td width=50% align='center'>> Yes</td></tr></table><hr width=75%>";
}
else
{
print "
You are not married!
<hr width=75%>> Back<hr width=75%>";
}
}
function divorce_confirm()
{
global $db,$ir,$c,$userid,$h;
if ($ir['marriage'])
{
print "
You divorced your partner!
<hr width=75%>> Back<hr width=75%>";
$db->query("UPDATE users SET marriage=0 WHERE userid={$ir['marriage']}");
$db->query("UPDATE users SET marriage=0 WHERE userid=$userid");
}
else
{
print "
You are not married!
<hr width=75%>> Back<hr width=75%>";
}
}
function send_note()
{
global $db,$ir,$c,$userid,$h;
if (!$_POST['note'])
{
print "
<form action='marriage.php?action=note' method='post'>
Please type a love note to send to your partner.
Note:
<textarea rows='5' cols='34%' name='note'></textarea>
<input type='submit' value='Send' />
</form>
<hr width=75%>> Back<hr width=75%>";
}
else
{
$note=str_replace(array("\n"),array("
"),strip_tags($_POST['note']));
$db->query("INSERT INTO mail VALUES ('',0,$userid,{$ir['marriage']},unix_timestamp(),'Love Note','$note')",$c) or die($db->error());
$db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$ir['marriage']}");
print "
Your love note was sent to your partner!
<hr width=75%>> Back<hr width=75%>";
}
}
$h->endpage();
?>