Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-15-2008, 12:43 PM Sign Up Script!!!!
Novice Talker

Posts: 5
Name: Matt Covalt
Trades: 0
Ok... this is my first thing I have done on this site.

So here's the deal. As a learning project I have to create a web site that serves as an open chat room. For the chat room I will probably just use a simple IRC client. That would be easy but I have a few things that aren't making this such a breeze:

1. I need to write a full login, logout, email password, and sign up scripts
2. All of the work has to be manually written with Notepad (or an alternative text editor). No easy programs that do all of the hard work for you.

Here is the site: http://goboone.net/~mcovalt/. The place I am stuck at is the PHP. The HTML and CSS came pretty naturally but this PHP thing is giving me hell. What I need to do now is create the PHP script that creates a new user in the MySQL table securely. Any help would be greatly appreciated.

***A couple of notes:***
1. I am totally new to Web Dev. Haven't looked at code in my life prior to this project.
2. If you want to login to the site the only user is: "bt" and the password is "test".
3. If I forgot to mention anything, just let me know and I will try to respond as quickly as possible.
4. I'm not going to be the fastest responder... I have to juggle school, work, and a social life
5. Thanks!!!!!
__________________
--Matt Covalt
--The fifteen year old PSP Hacker from around ASU... Home of the three time championship Mountaineers

Last edited by mcovalt; 03-15-2008 at 01:17 PM..
mcovalt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2008, 01:21 PM Re: Sign Up Script!!!!
Novice Talker

Posts: 5
Name: Matt Covalt
Trades: 0
Ok, after working solo on it for around 30 minutes I started this:

PHP Code:
<?

require_once("dbconnect.php"); 

$SQL "SELECT * FROM users WHERE email LIKE '$_POST[email]'"
//echo $SQL; 

$result mysql_query($SQL); 

if (@
mysql_num_rows($result) < 1){
    echo 
"Only one account per user! <a href="./signup.php">Try Again</a>";
    exit();
}

?>
All it does so far is check for existing users, but I don't think I did it right at all.
__________________
--Matt Covalt
--The fifteen year old PSP Hacker from around ASU... Home of the three time championship Mountaineers

Last edited by mcovalt; 03-15-2008 at 01:44 PM..
mcovalt is offline
Reply With Quote
View Public Profile
 
Old 03-16-2008, 06:34 PM Re: Sign Up Script!!!!
Novice Talker

Posts: 5
Name: Matt Covalt
Trades: 0
bump...

anyone????????
__________________
--Matt Covalt
--The fifteen year old PSP Hacker from around ASU... Home of the three time championship Mountaineers
mcovalt is offline
Reply With Quote
View Public Profile
 
Old 03-16-2008, 11:13 PM Re: Sign Up Script!!!!
Junior Talker

Posts: 4
Trades: 0
Ok you need to have a database setup, which has required fields (username password email etc etc)

LOGIN

<?php

/database connection code

$loginname = $_POST['loginname'];
$password1 = $_POST['password'];
$password = md5($password1);

/$loginname grabs whatever is typed in the html <from name="loginname"
/action="login.php> (the interface you make)
/$password1 same but with password
/$password encrypts $password 1 using md5 encryption thus securing users
/password
//Here we check if the user exists and the password is correct
$getuser = mysql_query("SELECT * FROM tablename WHERE loginname = 1"'$loginname."1 AND password = '".$password."' ") ;
$user = mysql_fetch_assoc($getuser);
//If there is a match, we can allow them to login
if (mysql_num_rows($getuser) == 1)
{
/do whatever after successful login
}
else
{
/redirect back to login
}
?>



I'm not an expert coder, having problems myself with some parts of php but I got a complete login working from that basic piece of code without any problem.

Registration is essentially read the fields of the html form, set them as variables then INSERT into database, read up a tutorial on it or pm me I'll edit my registration although it would be easier to make one yourself than to edit mine using your fields (mine has race options selects etc part of a game).

for the chat box I'm looking at that for myself also.
NewbieDeveloper is offline
Reply With Quote
View Public Profile
 
Old 03-17-2008, 08:54 AM Re: Sign Up Script!!!!
Novice Talker

Posts: 5
Trades: 0
www.hotscripts.com will have tons of membership scripts
mail8769 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sign Up Script!!!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29559 seconds with 12 queries