Page 1 of 1

New Website

Posted: Sun Apr 18, 2004 6:14 pm
by undershot
Hi, I'm starting up a new website at http://www.itwasgreg.net, which is soon to become http://www.undershot.co.uk.

The idea behind the site is that bands can add/edit/remove live dates. This will give me a list of all local gigs, which I can then look through either by band, or all of the results.

I have this database already set up, but the thing I'm now wanting to do, is to allow bands to register themselves to the site through a form, so that they can have their own password and username.

What fields do you reccomend I have in a database (MySQL) to accomodate for all possible bits of data I'll get. And how should I go about making a registration screen, and login screen? (+ scripts)

I currently have a password protected directory for the members area, where all bands have the same password and username. The problem with this is, new bands will have to email me for the password/user, and also have the possibility of messing with other bands live dates.

Cheers, Ryan.

Posted: Mon Apr 19, 2004 6:41 am
by kettle_drum
Well at the very minimum you will need to store the username and password in the database - but i guess that you will want to also store things like bandname, contact details, style of music, number of band members, date joined, gigs played...etc.

Then you can just make a registration form - collects a username and password - save it to the database.

Then have a login form that takes the username and pass - compaire them to the details in the database and if they match then you can log them in. Keep them logged in either by using cookies or sessions and check the details each time a page is loaded - then its just a simple:

Code: Select all

if($logged){
   //show member page
}else{
   //show login/error page
}

Posted: Tue Apr 20, 2004 4:50 pm
by undershot
Yeah, I've been looking into sessions, and I can't seem to be getting them to work, becuse when I try to display the information I've stored, well, it doesn't.

I use the script below to store the sessions:

Code: Select all

session_start();
header("Cache-control: private"); // IE 6 Fix.
$_SESSIONї'band'] = $band;
$_SESSIONї'password'] = $password;
And this one to read the cookies, are these right?:

Code: Select all

session_start();
header("Cache-control: private"); // IE 6 Fix.
echo $_SESSIONї'band'];

Posted: Tue Apr 20, 2004 5:05 pm
by tim
$_COOKIE['name']; to read cookies

Are $band defined vars?

type in

echo $band; before u assign it a session var and see if its defined.

Posted: Tue Apr 20, 2004 5:16 pm
by llanitedave
Just a bit of advice: Have separate tables for the bands and the band members. The reason for this is that musicians tend to be nomadic, and you don't want a former member of a band getting into its data and messing things up.

Posted: Tue Apr 20, 2004 5:39 pm
by ]{ronic
Hey undershot

That scrolling text at the bottom of your page ... Is that a php function that is scrolling text from your data base?

Am I able to get the code for that .. ?


Thanks

]{ronic

Posted: Tue Apr 20, 2004 7:39 pm
by undershot
I've only put the following fields in my database:
- Band
- Password
- Contact Name
- Email
- mp3_url
- mp3_name
- url
- location

I decided not to put the band members in until I manage to get the site up and running.

I've now got the login and register system functioning, I still need to put a few things on the site in the members area sense, like change password, change details. But if you're in a band, you can now join up. :D

How'd you all like the idea by the way? it's a bit like burbs.co.uk which is now huge, but better, in the sense that burbs has a <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> looking design, and not much detail, nevermind not having a live dated database.

The scrolly thing. I've heard about functions, but I've never really looked into them, I know 1 of you will say they're life savers, but I'm happy as I am at the mo. lol. I basically used the following concept:

Code: Select all

<marquee behavior="scroll" direction="left" style="border: 0px;" width="460" truespeed scrollamount="1" scrolldelay="15"><? include("config.php");
$query = "SELECT field1, field2, field3 FROM table LIMIT 5";
$result = mysql_query($query);
while(list($field1, $field2, field3) = mysql_fetch_row($result)) 
echo("<a href="url.php?var=$field1">&#1111;$field1 - $field2 - $field3]</a> "); ?>
</marquee>
I also used my own little dating scheme in the query (WHERE $today >= $date).

Cheers. (oh, if possible, check out the band serotonin which are in the database, the bands website is at http://www.serotoninweb.com)

Small post, hehe