Help Please?

dipeshsilwal1

New Member
Messages
184
Reaction score
0
Points
0
Hi i want to put a registration form in my website so that people can register it and can access through my mp3z... But i don't know how to create a registration form and a log in form. So Please Help me and send me a tutorial on how to make 1....... Please.

I Really need that............... Thank you for time.....:eek:riginal:
 

stuffradio

New Member
Messages
38
Reaction score
0
Points
0
Guess no one cares or is smart enough to post anything here, hmmm. Guess I have to help you out a bit.
call this register.php
PHP:
<?php
include("config.php");
if (!$action) {
echo "<form action=register.php?action=register method=post>";
echo "Name <input type=text name=name><br>";
echo "Password <input type=text name=password><br>";
echo "<input type=submit value=register>";
}
if ($action == register) {
include("config.php");
$add = mysql_query("INSERT INTO database (name, password) VALUES ('$name', '$password')")
or die(mysql_error());
echo "Registered succesfully, go <a href=index.php>Back</a>";
}
?

call this config.php
PHP:
<?php
$db = mysql_connect("localhost", "username", "password");
	mysql_select_db("database");
?>

There, I just quickly typed that out, hope that helps, and good luck with your website! :D


PS: Edit the things to your likings, the form isn't exactly organized but with tables and stuff you can make it all pretty neat, I haven't tested it so I don't know if it is bug free, if there are any errors post them here, I'll tell you how to fix it.
 
R

rhutchinson

Guest
well there are alot of php scripts out there that can help you with this take a look at hotscripts.com they have scripts for almost anything
 

dipeshsilwal1

New Member
Messages
184
Reaction score
0
Points
0
mysql_connect("localhost", "username", "password");
mysql_select_db("database");
WHat do i have to write in database and localhost???????????
 

stuffradio

New Member
Messages
38
Reaction score
0
Points
0
You can leave localhost the way it is. For the database write in the database name you are using. If you go to cpanel and go to mysql databases write one of the names of the databases that you want to use from that list you have there, or just make one and write in that exact name.
 

n4tec

Active Member
Messages
3,312
Reaction score
0
Points
36
mysql_connect("localhost", "username", "password");
localhost remains local host, create a username and password and then add the username to a database of your choice. and you need to put the exact username and pssword..

mysql_select_db("database");
database should be the d/base where the username and passord has been added..

*4*
 

dsfreak

New Member
Messages
1,338
Reaction score
0
Points
0
Yes, localhost remains, databse means which database in MYSQL you have for the script, username and pass can be whatever you set in MySQL manager in Cpanel.... ok?
 

flapietoetoe

New Member
Messages
226
Reaction score
0
Points
0
wouldnt it be easy is u´d have a prefix for the sql so that it wont occupy a whole database,
 
Top