Jump to content

Build a profile page


Danny620

Recommended Posts

ok i am only 16 and have been learning php for so long what i wish to make is a login page that takes you to your user profile.

 

e.g i login as a user and infomaion about me is there like picture of me and stuff about me

then i want it where other user can view my profile please help as i have this really good idear for a website and have been trying to build it for about 6 mouths i also have mysql

 

if u wish to know the idear and help me build it pm me

 

i have 2 hosting packges costing me over £100 as

Link to comment
Share on other sites

dont u think i have tryed googling it and that tut just teachis you how to build a login

 

lmao... then once you have done whats on that (after it teaches you how to build a login page lol)... just add:

 

header('location: where/ever/your/profile/page/is');

 

and your done...

 

You should probably know, i'm creating a profile site (taken me 1 and a half years to get to where it is) and my profile on that site is: http://www.coderprofile.com/coder/VBAssassin

 

I assume that's the sort of thing you mean by "profile" site?

 

Kind regards,

Scott

Link to comment
Share on other sites

Yes sessions are usually used to keep track of a users login.

 

A profile page might use sessions to look up the relevent data for the user currently browsing the page.

 

Like I said, if you knew php you would see that its a pretty straight forward task.

Link to comment
Share on other sites

mate well i think if u know php then you would explain it so shut up with your so called help full comments

 

buddy, settle down, like stated before, on the login page all you will do is

 

header ("Location: page.php");

 

and on that page, select the data from the sql database, and display it.

 

Like I said, if you knew php you would see that its a pretty straight forward task.

 

This is a true statement.

 

if You dont know php, sql, I suggest you go the freelancing forum and see if anyone will write it for you.

Link to comment
Share on other sites

if You dont know php, sql, I suggest you go the freelancing forum and see if anyone will write it for you.

 

Or freakin learn to code before asking for help.

 

L2CODE buddy. Plenty of free tutorials online for registration system, also plenty of free PHP and MySQL books online. When you actually have code written and are receiving an error/problem then post here for the answer to that problem/question.

 

As far as someone telling you each step to do it in, no thanks. No one on here gets paid to do all the work for someone, freelance forum is your best bet.

Link to comment
Share on other sites

Look, lets not get feisty. If you know a little php you should be able to get this done. You just need to step through the process.

 

I may have been a little quick with my earlier replies but that is simply because I was at work.

 

There's a few steps (or pages even) involved in what you want to do.

 

1. You'll need a sign up page. This page would ask a user to supply a username and password along with any other information you would like to display on there profile.

 

2. You need a login page. This page would ask for a users username and password, it then checks against the database to see if the user exists. If they do log them in using sessions, then redirect them to the profile page.

 

3. The profile page. This does two things. Firstly, if called without any extra parameters in the url it will check to see if the user is logged in, if they are, it will query the database for there information and then display it. Otherwise, if passed a username via the url (eg; profile.php?user=foo) it will query the database table for the desired user (eg; foo).

 

Without actually programming the system for you this should be pretty much all you need to get coding.

Link to comment
Share on other sites

look i have two php at home ok but it just has'tn got the stuff i need in it and what do u think i am doing i am trying to learn php put all u muppits wont help me all i am asking is for somebody to explain how it works ok

 

Insulting people generally doesn't get them to help you.

 

You're asking people to "explain how it works".

 

We're telling you to "learn PHP".

 

There are no lack of resources online that explain stuff like this.  Or buy a book if you're into that sort of thing.  If you don't know PHP how are you going to correct bugs when stuff goes wrong?  If you take the time to learn the basics and how PHP and a database work with each other, building a profile page is really one of the easier things you can do, and thorpe (the administrator of this fine forum who you happened to tell to shut up, btw) just gave you the basics.

Link to comment
Share on other sites

Look, lets not get feisty. If you know a little php you should be able to get this done. You just need to step through the process.

 

I may have been a little quick with my earlier replies but that is simply because I was at work.

 

There's a few steps (or pages even) involved in what you want to do.

 

1. You'll need a sign up page. This page would ask a user to supply a username and password along with any other information you would like to display on there profile.

 

2. You need a login page. This page would ask for a users username and password, it then checks against the database to see if the user exists. If they do log them in using sessions, then redirect them to the profile page.

 

3. The profile page. This does two things. Firstly, if called without any extra parameters in the url it will check to see if the user is logged in, if they are, it will query the database for there information and then display it. Otherwise, if passed a username via the url (eg; profile.php?user=foo) it will query the database table for the desired user (eg; foo).

 

Without actually programming the system for you this should be pretty much all you need to get coding.

 

 

oh and thanks for that i am also sorry for having a go its just that i have spent weeks on trying to figure this out and i am not getting anywhere that info you posted above has helped me know whats invilde and would like to thank you no all i need to do is learn stuff to do with the above put if u think you can help me then look at my website i have put a example of what i mean

Link to comment
Share on other sites

you best bet, start reading tutorials that they have suggested.

What is your php experience?

have you made queries?

if you can make db queries, spell correctly, and use sessions for security... you're on your way.

 

 

Hey VBAssassin, I want to play Slime Wars Game v1      Sounds fun.

Link to comment
Share on other sites

right i have made a sign script but the only thing that does work is the email it don't insert into the database for some reson here is my script

 

<?php

// Connects to your Database

mysql_connect("localhost", "**", "***") or die(mysql_error());

mysql_select_db("web160-admin-21") or die(mysql_error());

 

//This code runs if the form has been submitted

if (isset($_POST['submit'])) {

 

//This makes sure they did not leave any fields blank

if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2']) {

die('You did not complete all of the required fields');

}

 

// checks if the username is in use

if (!get_magic_quotes_gpc()) {

$_POST['username'] = addslashes($_POST['username']);

}

$usercheck = $_POST['username'];

$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")

or die(mysql_error());

$check2 = mysql_num_rows($check);

 

//if the name exists it gives an error

if ($check2 != 0) {

die('Sorry, the username '.$_POST['username'].' is already in use.');

}

 

// this makes sure both passwords entered match

if ($_POST['pass'] != $_POST['pass2']) {

die('Your passwords did not match. ');

}

 

// here we encrypt the password and add slashes if needed

$_POST['pass'] = md5($_POST['pass']);

if (!get_magic_quotes_gpc()) {

$_POST['pass'] = addslashes($_POST['pass']);

$_POST['username'] = addslashes($_POST['username']);

}

 

// now we insert it into the database

$insert = "INSERT INTO users (username, password, realname, email)

VALUES ('".$_POST['username']."', '".$_POST['pass']."', '".$_POST['realname']."', '".$_POST['email']."')";

$add_member = mysql_query($insert);

?>

 

 

<h1>Registered</h1>

<p>Thank you, you have registered - you may now login</a>.</p>

 

<?php

}

else

{

?>

 

 

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

<table border="0">

<tr><td>Username:</td><td>

<input type="text" name="username" maxlength="60">

</td></tr>

<tr><td>Password:</td><td>

<input type="password" name="pass" maxlength="10">

</td></tr>

<tr><td>Confirm Password:</td><td>

<input type="password" name="pass2" maxlength="10">

</td></tr>

<tr><td>Real Name:</td><td>

<input type="text" name="realname" maxlength="40">

</td></tr>

<tr><td>Email:</td><td>

<input type="text" name="Email" maxlength="40">

</td></tr>

<tr><th colspan=2><input type="submit" name="submit" value="Register"></th></tr> </table>

</form>

 

<?php

}

?>

 

Link to comment
Share on other sites

please use [ code ][ /code ] tags (without the spaces between [])

[ code ]stuff[ /code ]

without spaces

stuff

you can modify your last post or repost with the code inside the tags. otherwise I will not read your code and 90% of this online community will not either (or 99% of the gurus WILL NOT read it).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.