|
|
|
|
![]() ![]() |
Dec 15 2005, 04:46 PM
Post
#1
|
|
|
Member [ Level 1 ] Group: Members Posts: 45 Joined: 12-December 05 From: IJsselstein Netherlands Member No.: 10,088 |
Me and my friend are building a website for friends, were they can login with their own username and password.
On the site our friends can react on polls, and that kind of stuff. We want to get this in a database, wich only we 2 can see. Can someone tell us how we have to do this? Greetings, Mark&Guido This post has been edited by miCRoSCoPiC^eaRthLinG: Dec 30 2005, 07:10 PM |
|
|
|
Dec 15 2005, 04:58 PM
Post
#2
|
|
|
Hedonist at large Group: Members Posts: 610 Joined: 30-July 05 From: another realm Member No.: 7,524 |
|
|
|
|
Dec 15 2005, 11:15 PM
Post
#3
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
You would definately want to use a CMS like abhiram said, and with a hosting account you could choose either Mambo or PHP-Nuke which I am more partial to since I run four PHP-Nuke sites , two running with Invision board forums and two with phpBB2 forums.
You can make them anyway you want (within possibilities of the system) and they are very easy for someone who has never run a site before. Basically all you have to do is create a database populate it then upload the edited config.php file that tells your database about where to find its info and set it up. Or I think if you use one of the ready to go CMSs from astahost all you do is click the link in the cPanel then set up your Admin information then go to your new site and proceed to set it up the way you like. |
|
|
|
Dec 30 2005, 07:01 PM
Post
#4
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 28 Joined: 30-December 05 Member No.: 10,368 |
If you want to code it yourself create a table that will consist of 2 columns: user name and password hash. This you will need for your user's data storing. If there is a guest book on your site create a table with may be 4 columns that are: record id, name of a user who posted it, his e-mail address and a text of a message. Something like this
|
|
|
|
Dec 31 2005, 04:07 AM
Post
#5
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 5 Joined: 30-December 05 From: Bangkok, Thailand Member No.: 10,365 |
make check session for stuff and make table for stuff
make new table by use phpMyAdmin make check session for stuff but you must have start session function in process login page same this CODE session_start(); $_SESSION[sess_userid]=session_id(); $_SESSION[sess_username]=$username; header("Location:where"); here is code CODE <? session_start(); $sess_userid=$_SESSION[sess_userid]; $sess_username=$_SESSION[sess_username]; if ($sess_userid<>session_id() or $sess_username=="") { header("Location:index.php(or where that you need)"); exit(); } $host="localhost"; $user="username"; $pass="password"; $dbname="database name"; $connect=mysql_connect($host,$user,$pass); if(!$connect) { echo"Can't connect to sql"; exit(); } $sql="SELECT * FROM tbname WHERE username(field that is username)='$sess_username' "; $result=mysql_db_query($dbname,$sql); $num=mysql_num_rows($result); mysql_close(); if ($num<=0) { header("Location:index.php(or where you need when he or she don't have permission)"); exit(); }else{ } ?> to use insert the following code into page that for staff CODE <?php include "name of check session page that you saved"; ?> |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 01:29 AM |