ezeuba Posted August 5, 2007 Share Posted August 5, 2007 Good day all. I am very new to this php-mysql language, having come from using frontpage as my designer. I recently switched to dreamweaver after hearing folks sing its praise. I am now building a website with mysql database which I have already created, having used phpmyadmin(great tool), I have also layed out my pages but my problem is getting the login and data display pages to work. The data insertion works like a breeze, but I cannot seem to get the right way to get deamweaver setup these other pages correctly, because I want to use a username and password criteria to display data from the mysql database when user logs in, and only his data, hence the username and password criteria. The most I can get from dreamweaver is to use only password, via the recordset. When I try advanced mode it crashes because I cannot get the parameters correct. I used to do this fine and well with frontpage and access database. I wonder if I shouldn't go back to frontpage and access, it served my purpose only that I want to try new technologies in webdesign. I would appreciate any and all help anyone can render towards solving this problem. In a nutshell I need to display user data when he logs in with his username and password. Thank you all. Quote Link to comment Share on other sites More sharing options...
Hybride Posted August 5, 2007 Share Posted August 5, 2007 If am not mistaken, basically you want a profile page to show up of this persons data? Try this, as the profile page: ob_start(); session_start(); $username = $_SESSION['username']; //grabs the username from previous page //Grab user Data $query = "SELECT * FROM users WHERE username = '$username'"; // grabs data where username is selected $result = mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_ASSOC); if ($result) { $_SESSION['username'] = $row[username]; //change session to row $_SESSION['password'] = $row[password]; } ?> <br /> USERNAME: <? print $_SESSION['username']; ?><br /> PASSWORD: <? print $_SESSION['password']; ?><br /> You can also change the $query to $query = "SELECT * FROM users WHERE username = '$username'" AND password='$password'"; if you want to match both of them/"hightened" security. Whooh, hope that helps somewhat. ; Quote Link to comment Share on other sites More sharing options...
moberemk Posted August 5, 2007 Share Posted August 5, 2007 If you don't have a lot of PHP experience, try picking up the Dreamweaver Developer's Toolbox from Adobe-it works really well and makes stuff like that easy. It's expensive, though, the real caveat of the program; but it has many useful features. 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.