Help needed Configuring php mysql script

ohreally

New Member
Messages
4
Reaction score
0
Points
0
Hi guys!

I recently decided to add a user registration form to my website. I purchased an Adobe Dreamweave extension which allows me to convert my form into one capable of working online. I would very much appreciate any help you guys can give.

First they ask for the database username (now when I made the mysql database the username was ohreally_dbusername do I just put dbusername or do I need the ohreally to?)

For host can I keep it s localhost?

Also do I need to make any tables in mysql? I haven't a clue what to put in the table though (Its been awhile) There is a tables.php file and some other table files too.


If anyone could help me I would truely be in your debt, thanks again!
 

sikuneh

New Member
Messages
55
Reaction score
0
Points
0
You need to include your login name (for cPanel) with an underscore and then your username cPanelName_dbusername (or in your case, yes, ohreally_dbusername)

Localhost is the easiest way to connect to the server.

You should create a table in your database, call it 'users' or something. A good basic template (depending on what your site is for) id (for easy referencing), username (their chosen username for logging in) their password (their chosen password, for security you may choose to use a md5($_POST['password']) to encrypt it so it is harder to read and do not forget on a log-in script you write $password = md5($_POST['password']) so A) It doesn't get unenctypred, and B) it works) email address (for confirmation and letters from the site) and whatever else is dependent on your site. So it should be:
id, username, password, email, etc.

IMO it is easy to write a .SQL file and import it into the database. This is assuming table.users is not already created:
Code:
CREATE TABLE users(id int(255) AUTO_INCREMENT PRIMARY KEY, username varchar(20), password(50),email varchar(50), otherFieldsNecessary fieldType(fieldSizeIfNeededDefined))

Note: Don't forget that, to reference your database, you need to write your cPanel username like above when defining your database connection:
PHP:
ohreally_dbName

Hope that helps.
 
Last edited:

ohreally

New Member
Messages
4
Reaction score
0
Points
0
I thank-you so much for your help! I got it working :( silly me I had that but had to change the path for the e-mail and the redirect. I thank-you so much :D I guess the extension had that done, but if anyone is reading this sikuneh's advise will work too
 
Last edited:
Top