Phase Error I can't seem to find :(`
Posted on
16th Feb 2014 07:03 pm by
admin
Hey guys, I can seem to find my phase error on this. I am getting this error
[error]
Parse error: syntax error, unexpected $end in /home/klrbal/public_html/Mafia-test/tempfam.php on line 524[/error]
Well, 524 is the LAST line in my script. I know that it usually means that there is a } missing somewhere, but I can't seem to find it. Can anyone help?
Code: [Select]<?
session_start();
if (!(isset($_SESSION["real_name"])))
{
//echo "I'm not logged in";
header('Location: index.php');
}
else
{
echo "";
}
?>
<html>
<head>
<title>Mafia Syndicate BETA .::. Families</title></head>
<link REL="stylesheet" TYPE="text/css" HREF="main.css">
<script language=javascript src=Menus.js></script>
<body background="wallpaper.jpg">
<center>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="95%" class="cat">
<TR>
<TD width="150" background="tdbg3.jpg" bgcolor="#222222" valign="top">
<?php include("leftmenu.php");?>
</TD>
<td width="100%" valign="top">
<?php
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM crews WHERE name='$crew' LIMIT 1"));
////CREATE CREW/////
if ($_POST['createfamily'] && $_POST['familyname']){
$familyname == $_POST['familyname'];
if ($rankpoints <= 140109){
echo "You must be Underboss before you can make a crew!";
}else{
if ($crewlevel==0){
$finalcash = $cash - 500000000000 ;
if ($finalcash <0){
echo "You do not have enough cash!";
}elseif ($finalcash >=0){
$num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE id >1"));
if ($num_true >= 5){
echo "There are already 5 Crew Slots!";
}else{
$num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE name='$familyname'"));
if ($num_true >= 1){
echo "There is already a Family with that name!";
}else{
function change($msg){
$post = $msg;
$post = str_replace("'", "`", $post);
return $post;
}
$new=change($crewname);
mysql_query("INSERT INTO `family` ( `id` , `owner` , `name` , `bank` , `quote` , `news` , `slot` ) VALUES ('', '$username', '$new', '0', 'No Quote!', 'You have no family news8)', '50')");
mysql_query("UPDATE users SET famlevel='9' WHERE username='$username'");
mysql_query("UPDATE users SET cash='$finalcash', family='$new' WHERE username='$username'");
mysql_query("INSERT INTO `logs` ( `id` , `who` , `action` , `date` , `ip` ) VALUES ('', '$username', 'Bought a Family called <b>$new</b>!', '$date', '$realip')");
echo "You have created the Family <b>$new!</b>";
}
}
}
}
}
}
if ($_POST['cancelapply']){
mysql_query("DELETE FROM famreq WHERE username='$username'");
echo "You have cancelled your application!";
}
/////END OF CREATE CREW!!!/////
if (famlevel->2);
if ($_POST['inviteuser'] && strip_tags($_POST['inviteusername'])){
$sql2="SELECT * from famreq WHERE username='$username'";
$result2=mysql_query($sql2);
$num_true=mysql_num_rows($result2);
if ($num_true >= 1){
echo "You have already pending Family request!";
}elseif ($num_true <=1){
$crewnamejoin = $_POST['inviteusername'];
$crewnamejoin = strip_tags($inviteusername);
$sql="SELECT * FROM users WHERE username='$username'";
$result=mysql_query($sql);
if ($_POST['acceptinvite']){
$sql="SELECT * from famreq WHERE family='$famid'";
$result=mysql_query($sql);
mysql_query("INSERT INTO `famreq` ( `id` , `famid` , `username` , `status` , `f` ) VALUES (
'', '$invitedusername', '$username', '$status', '$f' )");
echo "You have requested $invitedusername to join your family!";
}
}
if ($_POST['leave'] && $famlevel >=2 && $famlevel <7){
if ($famlevel <= 0)
{
echo "You are not in a Family!";
}else{
if ($famlevel >= 4)
{
echo "You can not leave your family!";
if ($_POST['change'] && strip_tags($_POST['newfamname']) && strip_tags($_POST['famid']) && $userlevel >=10){
$newcrewname = $_POST['newfamname'];
$newcrewname = strip_tags($newfamname);
$crewid = $_POST['famid'];
$crewid = strip_tags($famid);
$sql="SELECT * from family WHERE id='$famid'";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
$oname = $rows['name'];
}
$num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE name='$newfamname'"));
if ($num_true >= 1){
echo "There is already a family with that name!";
}else{
function change($msg)
{
$post = $msg;
$post = str_replace("'", "`", $post);
return $post;
}
$newfamname=change($newfamame);
mysql_query("UPDATE users SET famname='$newfamname' WHERE famname='$oname'");
mysql_query("UPDATE famreq SET famid='$newfamname' WHERE famid='$oname'");
mysql_query("UPDATE forum_answer SET place='$newfamname' WHERE place='$oname'");
mysql_query("UPDATE forum_question SET place='$newfamname' WHERE place='$oname'");
mysql_query("UPDATE family_donations SET fam='$newfamname' WHERE famname='$oname'");
mysql_query("UPDATE family SET famname='$newfamname' WHERE id='$crewid'");
mysql_query("UPDATE BG SET crew='$newfamname' WHERE crew='$oname'");
echo "You changed the family $oname to $newfamname!";
}}
if ($_POST['dropfam'] && strip_tags($_POST['famnamedrop']) && $userlevel >=15){
$crewnamedrop = $_POST['famnamedrop'];
$crewnamedrop = strip_tags($famnamedrop);
mysql_query("DELETE FROM crews WHERE name='$crewnamedrop'");
mysql_query("UPDATE users SET crewlevel='0', crew='None' WHERE crew='$crewnamedrop'");
mysql_query("DELETE FROM crewapply WHERE crew='$crewnamedrop'");
mysql_query("DELETE FROM forum_answer WHERE place='$crewnamedrop'");
mysql_query("DELETE FROM forum_question WHERE place='$crewnamedrop'");
mysql_query("DELETE FROM crew_donations WHERE place='$crewnamedrop'");
echo "You have droped <b>$crewnamedrop</b>!";
}
if ($_POST['acceptbg']){
mysql_query("UPDATE BG SET status='Accepted' WHERE bg='$username' AND status='Pending'");
echo "You are now a bodyguard";
}
if ($_POST['acceptbg2']){
mysql_query("UPDATE BG SET status='Accepted' WHERE bg='$username' AND status='Pending'");
echo "You are now a bodyguard!";
}
if ($_POST['upgrade'] && $famlevel >=7 && $fetch->slot <500){
if ($fetch->slot ==75){$next=125; $upgradecost=10000000000;}
elseif ($fetch->slot ==125){$next=200; $upgradecost=150000000000;}
elseif ($fetch->slot ==200){$next=300; $upgradecost=20000000000;}
elseif ($fetch->slot ==300){$next=500; $upgradecost=30000000000;}
$newcash = $cash - $upgradecost;
if ($newcash <0){
echo "You do not have enough cash to upgrade!";
}else{
mysql_query("UPDATE family SET slot='$next' WHERE name='$name' AND owner='$username'");
mysql_query("UPDATE users SET cash=cash-'$upgradecost' WHERE username='$username' AND family='$famname'");
echo "Your Family size is now <b>$next</b>!";
}}
?>
<table border="1" class="sub2" align="center" cellspacing="0" cellpadding="1" bordercolor=black width=81%>
<tr>
<td align="center" colspan="5" class="header">Crews</td>
</tr>
<?
include "includes/db_connect.php";
$sql="SELECT * FROM family ORDER by id ASC";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
$name=$rows['owner'];
$famname=$rows['id'];
$famname2=$rows['name'];
$sql2="SELECT * from users WHERE family='$famname2'";
$result2=mysql_query($sql2);
$num=mysql_num_rows($result2);
?>
<tr>
<td width="70%"><a href="viewcrewprofile.php?viewcrew=<? echo $famname ?>"><? echo $rows['name']; ?></a></td><td width="20%"><a href="viewprofile.php?viewuser=<? echo $name ?>"><? echo $rows['owner']; ?></a></td><td width="10%"><? echo "$num"; ?></td>
</tr>
<?
}
?>
<tr>
<td colspan="5" align="right"><?
$num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE id >1"));
echo "$num_true"; ?>/5 Families</td>
</tr>
</table>
<td>
<?
$sql2="SELECT * from famreq WHERE famid='$famid' AND status='Pending'";
$result2=mysql_query($sql2);
$num_true=mysql_num_rows($result2);
?>
<? echo "$num_true"; ?>
</td><td align="center"><input type="submit" name="acceptreq" value="Accept"></td>
<tr>
<td class="header" colspan="2" align="center">Create Crew </td>
</tr>
<tr>
<td>
<p><font color="blue"><b>Making a family will Cost $500,000,000,000.
You must be ranked Underboss + to make a Family.</b></font></p></td>
</tr>
<tr>
<td width="92%" bgcolor="#3c3025" border="0">
<center>
Crew Name:
<input type="text" style="border:1px solid black;" name="familyname">
<input type="submit" value="Create Family" name="createfamily"></center> </td>
</tr>
<?
$num_true=mysql_num_rows(mysql_query("SELECT * FROM famreq WHERE username='$username'"));
if ($num_true == 1){
?>
<tr>
<td class="header" colspan="2" align="center">Pending Application</td>
</tr>
<?
include "includes/db_connect.php";
$sql="SELECT * FROM famreq WHERE username='$username'";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<tr>
<td colspan="2" align="center">
You have requested <b><? echo $username; ?></b>
<input type="submit" value="Cancel Application" name="cancelapply"></td>
</tr>
<?
}}
?>
</table></form>
<?
}
?>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="30%" class="sub2">
<?
$num_true=mysql_num_rows(mysql_query("SELECT * FROM BG WHERE bg='$username' AND status='Pending' AND crew=''"));
if ($num_true >= 1){
?>
<tr>
</tr>
<?
$sql="SELECT * FROM BG WHERE bg='$username' AND crew=''";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<tr>
</tr>
<?
}}
?>
</table>
<?
if ($famlevel >= 0)
{
?>
<form method="post" action="">
<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="30%" class="sub2">
<?
$num_true=mysql_num_rows(mysql_query("SELECT * FROM BG WHERE bg='$username' AND status='Pending'"));
if ($num_true >= 1){
?>
<tr>
<td class="header" colspan="2" align="center">Bodyguard Invitation</td>
</tr>
<?
$sql="SELECT * FROM BG WHERE bg='$username'";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<tr>
<td colspan="2" align="center">
You have been invited to be a bodyguard!
<input type="submit" value="Accept" name="acceptbg"></td>
</tr>
<?
}}
?>
</table>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="30%" class="sub2">
<tr>
<td class="header" colspan="2" align="center">Leave Crew</td>
</tr>
<tr>
<td colspan="2" align="center"><font color="red"><b>Note: Leaving crew can result in you losing up to 85% health</b></font>
<input type="submit" value="Leave Crew" name="leave"> </td>
</tr>
<? if ($crewlevel >=7 && $fetch->slot <200){ ?>
<tr>
<td class="header" colspan="2" align="center">Upgrade Crew Size</td>
</tr>
<tr>
<td align="center">
<?
if ($fetch->slot ==50){$next=75; $upgradecost=100000000;}
if ($fetch->slot ==75){$next=125; $upgradecost=1250000000;}
elseif ($fetch->slot ==125){$next=200; $upgradecost=1500000000;}
elseif ($fetch->slot ==200){$next=300; $upgradecost=3000000000;}
elseif ($fetch->slot ==300){$next=500; $upgradecost=5000000000;}
?>
Your Families current size is <b><? echo $fetch->slot ; ?></b>, it will cost $<? echo number_format($upgradecost); ?> to upgrade it to <? echo $next ;?>.
<input type="submit" name="upgrade" value="Upgrade">
</td>
</tr>
<? } ?>
</table>
<?
}
?>
</form>
<?
if ($userlevel >= 5)
{
?>
<form method="post" action="">
<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="30%" class="sub2">
<tr>
<td class="header" colspan="2" align="center">Change Family Name</td>
</tr>
<tr>
<td width="90%" align="center">Family ID:
<input style="border:1px solid black;" type="text" name="famid">
</td>
</tr>
<tr>
<td align="center">New family Name:
<input type="text" style="border:1px solid black;" name="newfamname">
<input type="submit" value="Change" name="change"> </td>
</tr>
</table>
</form>
<? }
?>
<?
if ($userlevel >= 15)
{
?>
<form method="post" action="">
<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="30%" class="sub2">
<tr>
<td class="header" colspan="2" align="center">Drop Family</td>
</tr>
<tr>
<td width="90%" align="center">
<center><select name="famnamedrop">
<?
include "includes/db_connect.php";
$sql="SELECT * FROM family ORDER by id";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<option><? echo $rows['name']; ?></option>
<?
}
?>
</select>
<input type="submit" value="Drop Family" name="dropfamily"></center>
</td>
</tr>
</table>
</form>
<? } ?>
</td>
<TD width="150" valign="top">
<?php include("rightmenu.php");?>
</TD>
</TR>
</table>
<? } ?>
</center>
</body>
</html>
Sorry, I'm still kinda new, so it's a little sloppy.
No comments posted yet
Your Answer:
Login to answer
305
7
Other forums
Call Screen statement Error
Dear Experts,
is there any setting that needs to be done before creating any dialog progr
Need PHP help... have all the elements... just need help putting them together :
Hey Guys,
I was wondering if someone could help me. I am doing a website for a client which
[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.
Fir
switch form actions? not working
i want on submit to go to different pages according to the CatID
Code: <?php $CatID=$_
if description does not contain the following words
Hello everyone,
I am parsing a MS Excel (.xls) file and adding it's content to a mySQL databa
Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this
File upload issues
Hi Guys,
Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat
how to make database item unique
Hey guys,
is it possible to do this:
I have the database item $title being pulled for
Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q
PHP mail() with images
I'm trying to get images to send along with my HTML e-mail sent through PHP mail(). I only tried vie