Jump to content
php.lv forumi

sesions


hEiti

Recommended Posts

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 by hEiti
Link to comment
Share on other sites

×
×
  • Create New...