Welcome! Log In Create A New Profile

Advanced

Login and Connect Pages

Posted by 49324063 Dee 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Login and Connect Pages
October 15, 2013 12:30PM
Hi Guys,

i would just like to find out something i've created my login page as well as my connect page which is to be included on all pages which needs the database connection but im busy with my team registration page now and i've come across an error

in my login page i have the variable $db followed by the database name im trying to connect to in this case it will be "login"

now these are the same details that are in my connect page, now when im trying to connect to my player registration page i assume if i use include"connect.php" this is incorrect because then its trying to establish a connection to login because ive listed $db as "login" now this will obviously be a major problem on all my pages or am i missing something?

if i remove the $db = login variable from the connect page my login fails

i would like to know if i use mysql_select_db i will be able to select any database and still use the connect page i currently have

can anyone please assist me im new to php so this portfolio has been pretty hectic for me
avatar Re: Login and Connect Pages
October 15, 2013 12:39PM
You should only have ONE database.
You put all your tables in the same database.

You only need one connect.php script for your entire site, which you "include" where required.

You select individual tables using SQL queries.

Eg: "SELECT * FROM myTable;"


It is possible to use multiple databases as you have, and still use one connect.php script.
You could use an if .. else construct to select the correct database based on the current page name, for example.

This is an unnecessary complication, but would work.
Re: Login and Connect Pages
October 15, 2013 01:11PM
Okay so from what i understand from your reply then i should only have one database which is obviously login and then i would have to create the tables underneath login that would make sense, sorry i totally misunderstood the instructions because if you read the tutorial letter

He points out twice as seen below

Fist instance

Database
Create a database with two tables.
• The first table (give it a name of your choice) is used for player registration.
• This table must have the following fields:

Second Instance

The club manager login page (login.php) functions as follows.
a. A login form on this page captures and processes the username and password of the user.
b. Create a database user login with username “admin” and password “admin” (not very secure, but easy for us to test your application!).
c. Any other combination presents an error message e.g. “Wrong username/password – try again!”

This is why i thought you would need to create two databases but i understand now

Thank you so much spinning smiley sticking its tongue out
Re: Login and Connect Pages
October 26, 2013 11:25AM
don't we have two tables?
namely list players and fixtures
Sorry, only registered users may post in this forum.

Click here to login