Danny620 Posted December 11, 2008 Share Posted December 11, 2008 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 Quote Link to comment Share on other sites More sharing options...
peranha Posted December 11, 2008 Share Posted December 11, 2008 You may need to post some code you currently have, almost everyone on here will not write things for you. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 thats the thing i dont have any code i am not sure how to take a user to there profile page please exaple to me how this would work Quote Link to comment Share on other sites More sharing options...
VBAssassin Posted December 11, 2008 Share Posted December 11, 2008 This is a huge subject and too general for anyone here to really reply to. Try google or something like this: http://www.phpeasystep.com/workshopview.php?id=6 Kind regards, Scott Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 dont u think i have tryed googling it and that tut just teachis you how to build a login Quote Link to comment Share on other sites More sharing options...
cmgmyr Posted December 11, 2008 Share Posted December 11, 2008 Check out this site: http://www.maaking.com/ he has a user login system that might give you a good start. Quote Link to comment Share on other sites More sharing options...
VBAssassin Posted December 11, 2008 Share Posted December 11, 2008 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 Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 yes that sort of profile i mean how do u create a site like that and for anyother user a profile like the one on this site ok Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 No one is going to answer that question in a simple forum reply. My suggestion to you would be to learn php, then all you need do is think through the process and program it. It wouldn't be too difficult if you knew php. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 ok then if nobody can tell me a script then could u please tell me whats involed in this like how it all works and if its to do with sessions Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 m8 well i think if u know php then you would explain it so shut up with your so called help full comments Quote Link to comment Share on other sites More sharing options...
peranha Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
premiso Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 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 Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
bluesoul Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 i have made a little example on my website of what i mean beacuse i think some of you dont know what i mean go to http://www.northplanet.co.uk/ Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 Yeah, thats pretty much what I described in my last reply. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 11, 2008 Author Share Posted December 11, 2008 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 Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 Yeah, I looked at your example. All you need do now is go through the process I descibed and write the code. I'm not sure what else we can do. Quote Link to comment Share on other sites More sharing options...
Brian W Posted December 11, 2008 Share Posted December 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 12, 2008 Author Share Posted December 12, 2008 so gueries are my answer Quote Link to comment Share on other sites More sharing options...
Danny620 Posted December 12, 2008 Author Share Posted December 12, 2008 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 } ?> Quote Link to comment Share on other sites More sharing options...
Brian W Posted December 12, 2008 Share Posted December 12, 2008 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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.