Jump to content
xisto Community
wannabeeaweak

How Do U Make Members Only Web-site

Recommended Posts

. . .my way. . if ($_COOKIE[username]) {#---member area} else {#---login in please}use cookie or session for your members.hope that help, but I'm not sure if it works. . .I'm a php newbie

Share this post


Link to post
Share on other sites

I Know a better way, first create the page and save as index.htm, create a directory inside your www folder, create a folder called site for example.Then go to the control panel under Site Managment Tools, select Web Protect. Now you have to select the folder to protect, select site, create user and password. Now upload index.htm inside of site directoryYou have to tell to the user go to page for example: your site.com/sitewhen somebody tries to enter into this directory will be appear a logging screen.

Share this post


Link to post
Share on other sites

Put authentification page on the first page, checking in beginning of each page, which returns user to index.php, if he didn't pass the check.

Third time, I will show all the script. What may I do else, if some people aren't able to look at other topics before creating new?)

Registering:

<?php	Error_Reporting(E_ALL & ~E_NOTICE);	if($login&&$password&&$email) {		if(file_exists("users/$login")) {			$mess="Ăèê çàíÿò!";		}		else {			mkdir("users/$login", 0777);			$fp=fopen("users/$login/main.txt", "w");			fwrite($fp, "$password|$email");			fclose($fp);			$mess="ĂùïüøíÎ.";		}	}	else {		$mess="ĂüãèùòðàÜèÿ";	}?><html><head>  <title>ĂüãèùòðàÜèÿ</title></head><link rel="stylesheet" type="text/css" href="sources/style.css"><body onload="java script: a=document.getElementsByTagName('img');for(n=0;n<a.length;n++){i=a[n]; if(i.width==468&&i.height==60){i.style.display='none';}}void 0;" style="margin-top: 130px;" background="sources/reg.jpg"><center><table style="background-image: url(sources/perg.jpg);"><form action="reg.php" method="post"><tr colspan="2"><td colspan="2" class=hid><center><?=$mess;?></center></td></tr><tr><td class=hid>ĂÎãèí:</td><td class=hid><input type="text" name="login" maxlength="30"></td></tr><tr><td class=hid>ĂĂ Ă°ĂŽĂŤĂź:</font></td><td class=hid><input type="password" name="password" maxlength="30"></td></tr><tr><td class=hid>E-mail:</font></td><td class=hid><input type="text" name="email" maxlength="30"></td></tr><tr><td class=hid><input type="submit" value="ĂÎòÎâÎ"></td><td class=hid><input type="button" value="ĂàêðÝòß" onclick='java script:window.close();'></td></tr></form></table></center></body></html>

Checking when enters:
<?phpError_Reporting(E_ALL & ~E_NOTICE);if($login&&$password) {		if(file_exists("sources/list.txt")) {			$fp=fopen("sources/list.txt", "r");			$lis="";			while(!feof($fp)) {				$lis.=fread($fp, 5016);			}			fclose($fp);			$all=explode("|",$lis);			foreach($all as $usr) {				if($usr==$login) {					$t=$usr;					break;				}			}			if($t) {				$fp=fopen("users/$t/main.txt", "r");				$line=fgets($fp, 1024);				$u=explode("|", $line);			if($u[0]==$password) {			$tr=1;			}			else {				$mess="ĂøèåÎáíÝÊ ĂŻĂ Ă°ĂŽĂŤĂź!";			}			}			else {				$mess="ĂøèåÎáíÝÊ íèê!";			}		}		else {			$mess="ĂàðüãèùòðèðóÊòüùß!";		}	}	else {		$mess="ĂàíðèóÏ";	}	if($tr) {		session_start();		session_register("login");		session_register("password");		Header("Location: game.php?PHPSESSID=$PHPSESSID");	}?>
Checking while travelling on the site:
<?phpError_Reporting(E_ALL & ~E_NOTICE);if($login&&$password) {		if(file_exists("sources/list.txt")) {			$fp=fopen("sources/list.txt", "r");			$lis="";			while(!feof($fp)) {				$lis.=fread($fp, 5016);			}			fclose($fp);			$all=explode("|",$lis);			foreach($all as $usr) {				if($usr==$login) {					$t=$usr;					break;				}			}			if($t) {				$fp=fopen("users/$t/main.txt", "r");				$line=fgets($fp, 1024);				$u=explode("|", $line);			if($u[0]==$password) {			$tr=1;			}			else {				Header("Location: index.php");			}			}			else {				Header("Location: index.php");			}		}		else {			Header("Location: index.php");		}	}	else {		Header("Location: index.php");	}?>

P.S. Don't forget about session_start(); in the beginning :o

Share this post


Link to post
Share on other sites
CrazyPencil, feel petty about you, the third time you post the same post in less than three hours, but these posts are not new anyway, all of them were posted before, i hope this will help us to get along with our sites, i appricate this help you do to us.

Share this post


Link to post
Share on other sites

A less sophisticated but quick and dirty way if you are using a CMS is just to make all of your pages content only viewable by people who sign in, and then set up your user privaledges as needed... well... I assume this would work. I've never tried it but since most CMS systems have user login stuff setup automatically it would make sense this was possible...

Share this post


Link to post
Share on other sites

With a CMS it is possible that those that are not registered will only see the content that they are authorised such as to register and maybe a news page or topic that only unregistered users will see when viewing your site, they can't view forums, they can't download files, post news articles actually just about anything. This is probably why it is called a content mamagement system or CMS for short. On my site unregistered users can view m downloads but not download them, and if I wanted they could view topics in the forums but not post or if I wanted they couldn't even view the topics if I wanted it to be that way.Using a content management system is definately the best way to go for almost total control over your site and its content and is not hard to learn to use one and set it up the way you want it, with very little knowledge of PHP or even HTML although knowing some of both is a great help.

Share this post


Link to post
Share on other sites

Upload photos by users? How do i make this available?

How Do U Make Members Only Web-site

 

Hi,

 

I need a lil help.

How do I make a form to allow viewers to upload photos to my site (not by them emailing them to me) just by them being able to click a button, browse for it and send it in.? I've seen this form oodles of times, but don't have a clue to how to make it?

 

Anyone help?

 

-lisa

Share this post


Link to post
Share on other sites
I want to create a link for the members that joined my company.How Do U Make Members Only Web-site

I have designed a website by myself on dreamweaver.  Now I want to create a link for the members who joined my program.  But I am not sure how to do that.  Basically what must happen is the pages are on the webpage but they will have to receive a link to advertise and then if somebody click on their link it will open their page on the website.

If anybody can help it will be appreciated.

 

Thank you

Michelle 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.