this code mess up my script , what is wrong in this php code ?
[php]if ($userinfo[‘access’] >= 1 or $_SESSION[‘id’] == $id )
{ $gb_options = ’ '; }
else ($_SESSION[‘id’] == $info[‘sender_id’])
{$gb_options = '
< '; }
[/php]
this code mess up my script , what is wrong in this php code ?
[php]if ($userinfo[‘access’] >= 1 or $_SESSION[‘id’] == $id )
{ $gb_options = ’ '; }
else ($_SESSION[‘id’] == $info[‘sender_id’])
{$gb_options = '
< '; }
[/php]
Change the “or” in the if() statement to “||”
else would need to be elseif()
or just [php]else {$gb_options = '
< '; }[/php]
[php]if ($userinfo[‘access’] >= 1 || $_SESSION[‘id’] == $id )
{ $gb_options = ’ '; }
elseif ($_SESSION[‘id’] == $info[‘sender_id’])
{$gb_options = '
< '; }[/php]
ohh yh that true , the error is gone now. but i added a else statement to make work right so i am wondering if
[php]else {$gb_options =’’;}[/php] makes a security risk ?
[php]if ($userinfo[‘access’] >= 1 || $_SESSION[‘id’] == $id )
{ $gb_options = ’ '; }
elseif ($_SESSION[‘id’] == $info[‘sender_id’])
{$gb_options = ‘
< ‘; }
else {$gb_options =’’;}[/php]
I would send them to a different page or echo a error message.
but i want them to see it empty instead of images/links
btw , i need help with another thing . while clicking on the answer link/image , it show the textfield at the same page . i want it to open a new page , so it just show the form with text field . the code look like this
[php]if (isset($_GET[‘svara’]))
{
$sql = mysql_query(“SELECT * FROM members
WHERE id
= '”. $id ."’") or die(mysql_error());
$info = mysql_fetch_array($sql);
echo ’
I have marked it as solved and this link will open a new page.
<a href="page.php?action=GB&id='.$info['sender_id'].'&svara" target="_blank"><img src="images/gb_reply.png" title="answer" /></a>