Jump to content

unexpected '}'


almightyegg

Recommended Posts

I can't see what the problem with this is?

 

Parse error: syntax error, unexpected '}' in /home/lordofth/public_html/editlinks.php on line 101

 

if(!$setlink && !$set && !$delete && !$cancel){ ?>
<b>Custom Links:</b><br>
<?
if(!$mem[link1]){
echo "<a href='editlinks.php?setlink=1'>Set Link 1</a><br>";
}else{
echo "<a href='$mem[link1]'>$mem[linkn1]</a> [<a href='editlinks.php?setlink=1'>Relink</a>] [<a href='/editlinks.php?delete=1'>Delete</a>]<br>";
}
if(!$mem[link2]){
echo "<a href='editlinks.php?setlink=2'>Set Link 2</a><br>";
}else{
echo "<a href='$mem[link2]'>$mem[linkn2]</a> [<a href='editlinks.php?setlink=2'>Relink</a>] [<a href='/editlinks.php?delete=2'>Delete</a>]<br>";
}
if(!$mem[link3]){
echo "<a href='editlinks.php?setlink=3'>Set Link 3</a><br>";
}else{
echo "<a href='$mem[link3]'>$mem[linkn3]</a> [<a href='editlinks.php?setlink=3'>Relink</a>] [<a href='/editlinks.php?delete=3'>Delete</a>]<br>";
}
if(!$mem[link4]){
echo "<a href='editlinks.php?setlink=4'>Set Link 4</a><br>";
}else{
echo "<a href='$mem[link4]'>$mem[linkn4]</a> [<a href='editlinks.php?setlink=4'>Relink</a>] [<a href='/editlinks.php?delete=4'>Delete</a>]<br>";
}
if(!$mem[link5]){
echo "<a href='editlinks.php?setlink=5'>Set Link 5</a><br>";
}else{
echo "<a href='$mem[link5]'>$mem[linkn5]</a> [<a href='editlinks.php?setlink=5'>Relink</a>] [<a href='/editlinks.php?delete=5'>Delete</a>]<br>";
}
}elseif(is_numeric($setlink) == TRUE){
$update = mysql_query("UPDATE users SET qlupdate='$setlink' WHERE id='{$mem['id']}'");
echo "Direct to the page you wish to link in and confirm it on the right panel under the other links.";
}elseif($set == yes){
$link = $_POST['link'];
$linkn = $_POST['linkn'];
if(!$link){
echo "You haven't selected a link!";
}else{
$l = "link$mem[qlupdate]";
$n = "linkn$mem[qlupdate]";
$update = mysql_query("UPDATE users SET $l='$link',$n='$linkn',qlupdate='No' WHERE id='{$mem['id']}'");
echo "Your custom link was updated.";
}
}elseif(is_numeric($delete) == TRUE){
$update = mysql_query("UPDATE users SET link$delete='',linkn$delete='' WHERE id='{$mem['id']}'");
echo "You removed custom link number $delete.";
}elseif($cancel = yes){
$update = mysql_query("UPDATE users SET qlupdate='No' WHERE id='{$mem['id']}'");
echo "You cancelled the updating process.";
}
?>

 

I can't spot why it might be unexpected... any help would be greatly appreciated

 

Link to comment
Share on other sites

hi

 

towards the bottom if statement

 

$cancel = yes

should be

$cancel == yes

 

few more tips:

$l = "link$mem[qlupdate]";
$n = "linkn$mem[qlupdate]";

 

should be:

$l = "link{$mem[qlupdate]}";
$n = "linkn{$mem[qlupdate]}";

 

One more:

don't test if a var is set like this:

!$var

use isSet() like this:

!isSet($var)

 

I'd read through your php log file and correct the warnings it's printing

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.