Hello everyone,

I paid for this script which is a community that offers its members the chance to get a club and joijn other members clubs!

However, when people try to join a club they getb this error:

Parse error: syntax error, unexpected T_PRIVATE, expecting ']' in /home/cyberpet/public_html/club_join.pro.php on line 14

I have emailed the guy who owns the website and script who has not bothered replying to the many problems I have encountered so far. Luckily I have been able to sort through the other problems and have had to learn the script as I do not know PHP, MySQL etc.

The line of the script that the above error refers to is as follows:

<?php

/*

Join club (club_join.pro.php)

*/
ob_start();
$rank_check = 1;
include "global.inc.php";
$clubrank_check = 0;
include "club.inc.php";

if ($getclub[private]== 1)
{
    die(header(error("club.php?game=$game&clubid=$clubid","You can't join a private club.")));
}

kind regards

justin

Because private is a keyword in PHP. Also, when using a variable inside brackets is also requires the $.

Hello ...sorry about that! This is the full code for the document....

<?php

/*

Join club (club_join.pro.php)

*/
ob_start();
$rank_check = 1;
include "global.inc.php";
$clubrank_check = 0;
include "club.inc.php";

if ($getclub[private]== 1)
{
	die(header(error("club.php?game=$game&clubid=$clubid","You can't join a private club.")));
}

if ($clubrank > 0)
{
	die(header(error("club.php?game=$game&clubid=$clubid","You are already a member of this club.")));
}

if ($getmemberdata4[id])
{
	die(header(error("club.php?game=$game&clubid=$clubid","You are already a member of a club.")));
}

mysql_query("UPDATE clubs2 SET members = '$getclub[members]+1' WHERE id = '$clubid' AND game = '$game'");
mysql_query("INSERT INTO club_members2 (club,user,position,game) VALUES ('$clubid','$userid','1','$game')");
header(error("club.php?game=$game&clubid=$clubid","Thank you for joining $getclub[name]."));

?>

Wow thanks shawn. That seems to have done the trick!

Ive spent days trying to play around with the coding lol. Im very interested in learning PHP now as it facinates me.

Just need to work out how to allow members how to join more than one club lol.

Kind Regards

Justin

Hello, im having the same problem but i have a lot of "private", does every instance of it need the $

Here are some examples

$journal['private']

So does that private need a $

and what about something like

'private'		=> INT,

last but not least what about this

$entry['private']= $private;

the word "private" appears twice, do they both need the $ symbol?

Thanks a lot in advanced.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.