How can people Register on a site, and have it go to their profile? I need help...

This is a discussion on "How can people Register on a site, and have it go to their profile? I need help..." within the PHP Forum section. This forum, and the thread "How can people Register on a site, and have it go to their profile? I need help... are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old May 18th, 2008, 16:04
New Member
Join Date: May 2008
Location: Jacksonville, FL
Age: 19
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation How can people Register on a site, and have it go to their profile? I need help...

How would I do that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old May 18th, 2008, 16:13
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,340
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

Sorry imagehorizons, could you elaborate a bit more please?

Sounds like you're going to need a database and some server-side knowledge - for now I'll move this to the PHP Forum
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old May 18th, 2008, 17:09
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,255
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

First off, please repeat the question thats stated in the title, don't just say "how do you do that?"

And to do that you'll have to learn PHP (or ASP or something) Here's a very nice list of resources to learn PHP.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old May 19th, 2008, 16:43
Junior Member
Join Date: Aug 2007
Location: uk
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

I m working on a similar problem I have created a userform using PHP and Javascript for validation which writes to a MySQL database. Im going to use sessions to create a login area
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 19th, 2008, 19:22
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 220
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

To perform a user accounts page you need to create a login form that loads creates a session['ID'] variable once login validate is successfull!

Let me try to explain over a few steps:

First off login form:

i cannot be bothered typing the whole bunch of login code so u will have to set the connection variables & protect against mysql inject yourself:

The code below validates the user by this code:

PHP: Select all

$sql "SELECT * FROM data WHERE Username = '$login_name' && Password = '$login_pass'";
   
$result mysql_query($sql);
   
// Fetch data!
   
$row mysql_fetch_array($result);
   
$count mysql_num_rows($result);
   
// Validate login!
   
if ($count==1)
   {
       
$_SESSION['ID'] = $row['dataID']; // Notice here a  session is set
       
$_SESSION['Username'] = $row['Username'];
       
$_SESSION['Password'] = $row['Password'];
       
Header ('Location:' $re_direct);
   }
   else
   {
       echo 
"Username or password are incorrect";
   }
   
   
ob_end_flush(); 

Then from succesfull login you are directed to the accounts page & you will have to recall the session['ID'] like so:

make sure you use mysql_fetch_array to grab the data from rows after query, the all you have to do is echo the data from the datanase like this: <?php echo['Example coloumn']; ?>

PHP: Select all

<?php
    session_start
();
    
    
    
    if (empty(
$_SESSION['ID'])) {
    exit (
"You have to be logged in to view this page");  
    }
    
        include 
'db_fns.php';
        
$sql "SELECT * FROM data WHERE dataID=".$_SESSION['ID'];
        
$result mysql_query($sql);
        
$row mysql_fetch_array($result);
    
         
?>
Here is a example of echo data to appear were you want it on your page relevant to the registered session['ID'] in use:

PHP: Select all

<table border="0" cellpadding="5" cespacing="4">
<tr>
<td><strong>Name:</strong></td>
<td><?php echo $row['Name']; ?></td>
</tr>
Step 1: login & create sessionID - redirect to accounts page!

Step 2: start session\connect to server & select database!

Step 3: run query & fetch array from the result resource!

Step 4: echo colomns to display logged in users data!


Hope this helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 19th, 2008, 19:30
Junior Member
Join Date: Aug 2007
Location: uk
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

Thats a great help thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old May 19th, 2008, 19:34
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 220
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

No problem!! if you have any probelms creating the rest of the login form just egt in touch... Am a bit tipsy at the mo so excuse the poor spelling!!! Sessions are easy only when you have seen a example working infront of you!

Always start a session at the top of the page to be output first then simple run a query by the id, fetch array the result & echo out the data from the relevant rows 7 the session will do the rest even if it is a shopping cart or search engine.... easy peazy dude
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old May 19th, 2008, 19:57
Junior Member
Join Date: Aug 2007
Location: uk
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

thanks im gonna give that a go
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 7th, 2008, 04:18
New Member
Join Date: Jun 2008
Location: Los Angeles
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How can people Register on a site, and have it go to their profile? I need help..

I had a similar requirement for a client, and I used this subscription service instead of PHP/MySQL:

www.HostedDatabase.com

Check out this page on their site which explains how to set it up without any server code:

http://www.hosteddatabase.com/how_to_security.asp

You set up a custom database with all the field you want in the profile, then you create (or the users create) Users that can login and access/edit the profile info. You can also protect portions of your site so that only authorized users can gain access. They offer a free 30-day trial so you can set it all up and give it a spin.

Good luck.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
have a site- now people want to advertise - PANIC! sambkk Search Engine Optimization (SEO) 4 May 30th, 2008 15:51
Why can't some people see my current site? foldingvan Web Page Design 2 May 17th, 2007 12:39
out of site ideas help me out people ... bruno89 Webforumz Cafe 0 Nov 28th, 2006 07:06
how many people are on my site bruno89 Web Page Design 5 Oct 14th, 2006 23:29


All times are GMT. The time now is 16:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42