sandbudd Posted November 20, 2008 Share Posted November 20, 2008 I have a members login page that works where people can log in change pass etc... what I am trying to do is when some one logs in it gives them a folder that only they can view with different files. I have tried several options to call this folder without success. Here is the members page. I created a field in my table called site where I want them to have a link to click to their password protected folder but can't seem to get it to work. I am sure that is an echo statement but getting frustrated. Thanks. <?php require_once('settings.php'); checkLogin('1 2'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="css/styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container" style="text-align:center;width:230px;"> <?php echo 'Hello <em><b><u>' . get_username ( $_SESSION['user_id'] ) . '</u></b></em>!<br />You are now logged in.<br /><br /><a href="update_profile.php" title="update your profile">Click here</a> to update your profile.'; /* we show the manage users link only if the logged in member has admin rights */ if ( isadmin ( $_SESSION['user_id'] ) ): ?> <br /><br /> It seems that you're an admin. You may <a href="manage_users.php" title="manage users">manage users</a> or <a href="admin_settings.php" title="edit site settings">edit site settings</a>. <?php endif; ?> <br /><br /> <a href="logout.php">logout</a> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/133425-members-page-unique-page/ Share on other sites More sharing options...
sandbudd Posted November 20, 2008 Author Share Posted November 20, 2008 okay if I do this it displays the correct file how do I make it a link? <?php require_once('settings.php'); checkLogin('1 2'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="css/styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container" style="text-align:center;width:230px;"> <?php echo 'Hello <em><b><u>' . get_username ( $_SESSION['user_id'] ) . '</u></b></em>!<br />You are now logged in.<br /><br /><a href="update_profile.php" title="update your profile">Click here</a> to update your profile.'; $query = "SELECT * FROM `" . DBPREFIX . "users` WHERE `ID` = " . $db->qstr ( $_SESSION['user_id'] ); $row = $db->getRow ( $query ); $result = mysql_query($query); while($row = mysql_fetch_array($result)){ echo $row['site']; } /* we show the manage users link only if the logged in member has admin rights */ if ( isadmin ( $_SESSION['user_id'] ) ): ?> <br /><br /> It seems that you're an admin. You may <a href="manage_users.php" title="manage users">manage users</a> or <a href="admin_settings.php" title="edit site settings">edit site settings</a>. <?php endif; ?> <br /><br /> <a href="logout.php">logout</a> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/133425-members-page-unique-page/#findComment-693995 Share on other sites More sharing options...
sandbudd Posted November 20, 2008 Author Share Posted November 20, 2008 echo $row['site']; displays the proper link but how do I make it clickable? Link to comment https://forums.phpfreaks.com/topic/133425-members-page-unique-page/#findComment-694001 Share on other sites More sharing options...
daveoffy Posted December 3, 2008 Share Posted December 3, 2008 Somewhere above the echo $row['site'] put this $row['site'] = <a href=".$row['site'].">Site Name</a> That should make it so where ever you put $row['site'] it makes a link to your site with text Site Name. Link to comment https://forums.phpfreaks.com/topic/133425-members-page-unique-page/#findComment-704477 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.