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.
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause i am posting in the wrong area. I am starting from scratch with a new registration form for a
SQL Query/echo not working
Hey all,I'm trying to run (what I thought) was a simple operation and it isn't working. I haven't coded anything in about 2 years, and I'm self taught at that so I know I've got quite a few gaps in
Preserving user-entered linebreaks
Hi, I'm building a web 2.0 thingy from scratch and I wanna display text which users input. It's all good so far, except that all the linebreaks are destroyed, so no matter how carefully they insert
Problem in String replace program's output
Hi all,
sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that gave me permission to use it. He designed & coded one of them. Now the code seems to have
problem getting my contact form working
Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm having a real problem getting it functioning properly. My real issue is the user inputed
$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown reason i can echo the variable and it outputs the correct value but i cannot use that variable in
Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do delete on all indexes, but my question is that if I just clear the vector. Are the pointers
Big Problem!! Please help
Hi Guys,Im making a website for a friend have encountered a really annoying problem. When every i run the script below i get this error: "Parse error: syntax error, unexpected '}' in
PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the function at all. Why?<form action="member.php" method="post"