hEiti Posted June 13, 2008 Report Share Posted June 13, 2008 (edited) session_start(); if(isset($_SESSION['allow'])) $_SESSION['allow']=1; echo "<br><a href=\"news/{$lang}/read_more.php?newsid=$myrow[newsid]\">Read More...</a> || <a href=\"news/{$lang}/edit_news.php?newsid=$myrow[newsid]\">Edit</a> || <a href=\"news/{$lang}/delete_news.php?newsid=$myrow[newsid]\">Delete</a><br><hr>"; } else echo "Views=". $_SESSION['views']; echo "<br><a href=\"news/{$lang}/read_more.php?newsid=$myrow[newsid]\">Read More...</a>"; }//end of loop Ideja shim ir sekojosha kad logina ielogojoties pieskjir vertibu 1 ja ne tad 0 bet sheit news lapa ja lietotajam sesija ir 1 tad vinsh var edit un delite bet ja 0 tad var tikai read more .. sakiet kur man te sakas kljudainiba un nedarbiga zona... Kods no logina daljas //Login Successful session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID']=$member['member_id']; $_SESSION['ses_login']['id'] = $object->id; $_SESSION['ses_login']['usergroup'] = $object->usergroup; $_SESSION['allow']=1; session_write_close(); header("location: index.php?lapa=admin_suc"); exit(); }else { //Login failed $_SESSION['allow']=2; header("location: login-failed.php"); exit(); ceru kad kodi nav par garu priex shejienes :) Edited June 13, 2008 by hEiti Link to comment Share on other sites More sharing options...
andrisp Posted June 13, 2008 Report Share Posted June 13, 2008 (edited) Nu, vecīt, padomā taču pats... if(isset($_SESSION['allow'])) $_SESSION['allow']=1; A vispār problēma ir tur, ka tu neizmanto { un } priekš blokiem. Edited June 13, 2008 by andrisp Link to comment Share on other sites More sharing options...
Aleksejs Posted June 13, 2008 Report Share Posted June 13, 2008 Tev nav atverošo figūriekavu ne pie if(isset($_SESSION['allow'])) ne pie tam sekojošā else Link to comment Share on other sites More sharing options...
Recommended Posts