Jump to content

Laine

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Laine's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, it's working now. Just have some work to do on the profile.php. Thanks for the help This is the member list page: <?php include 'dbc.php'; page_protect(); ?> <html> <head> <title>My Account</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php include('includes/header.php'); ?> <?php include('includes/navmain.php'); ?><br><br> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="14%" valign="top"> <?php /*********************** MYACCOUNT MENU **************************** This code shows my account menu only to logged in users. Copy this code till END and place it in a new html or php where you want to show myaccount options. This is only visible to logged in users *******************************************************************/ if (isset($_SESSION['user_id'])) {?> <div class="myaccount" align="center"> <p align="center"><strong>My Account</strong></p> <a href="myaccount.php">My Account</a><br> <a href="mysettings.php">Settings</a><br> <a href="logout.php">Logout </a> </div> <?php } if (checkAdmin()) { /*******************************END**************************/ ?> <p align="center"> <a href="admin.php">Admin CP </a></p> <?php } ?> <p> </p> <p> </p> <p> </p></td> <td width="100%" valign="top" style="border: 2px solid #FFF"><p> </p> <h3 class="titlehdr">Player List</h3> <?php if (isset($_GET['msg'])) { echo "<div class=\"error\">$_GET[msg]</div>"; } ?> <?php echo "<table> <tr> <td>NAME</td> <td> TIMEZONE</td> <td> SERVER</td> <td> CLASS</td> <td> RACE</td> <td> AA</td> <td> LEVEL</td> <td> EPIC</td> <td> CURRENT GUILD</td> <td> WILLING TO TRANSFER SERVERS</td> </tr> <br /> "; $result = mysql_query("SELECT * FROM users WHERE looking='yes'"); while($row = mysql_fetch_array($result)) { echo "<tr><td>" . '<a href="profile.php?ID=' . $row['id'] . '">' . $row['user_name'] . "</a>" . "</td><td>" . " " . $row['timezone'] . "</td><td>" . " " .$row['server'] . "</td><td>" . " " .$row['class'] . "</td><td>" . " " . $row['race'] . "</td><td>" . " " . $row['aa'] . "</td><td>" . " " . $row['level'] . "</td><td>" . " " . $row['epic'] . "</td><td>" . " " . $row['guild'] . "</td><td>" . " " . $row['transfer'] . "</td></tr>"; } echo "</table>"; ?> </td> <td width="12%" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <?php include('includes/footer.php'); ?> </body> </html> This is the profile page: <?php include 'dbc.php'; page_protect(); $ID=$_GET['id']; ?> <html> <head> <title>Profile Search</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php include('includes/header.php'); ?> <?php include('includes/navmain.php'); ?><br><br> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="160" valign="top"> <? if (isset($_SESSION['user_id'])) {?> <div class="myaccount"> <p><strong>My Account</strong></p> <a href="myaccount.php">My Account</a><br> <a href="mysettings.php">Settings</a><br> <a href="logout.php">Logout </a> </div> <? } ?> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="732" valign="top"><p> </p> <h3 class="titlehdr">Profile of <? echo $member;?> </h3> <table width="80%" border="0" align="center" cellpadding="10" cellspacing="5"> <tr> <td><form name="form1" method="get" action="profile.php"> User Name: <input name="member" type="text"> <input type="submit" value="Search"> </form></td> </tr> </table> <? if (isset($_GET['msg'])) { echo "<div class=\"error\">$_GET[msg]</div>"; } ?> <p><? $query = "SELECT * FROM users WHERE user_name='$ID'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if($num == 0){ echo "No results to display, please search again."; }else{ $i=0; while($i < 1){ $full_name=mysql_result($result,$i,"full_name"); $user_name=mysql_result($result,$i,"user_name"); $user_email=mysql_result($result,$i,"user_email"); $website=mysql_result($result,$i,"website"); $date=mysql_result($result,$i,"date"); echo "<table border RULES=NONE FRAME=BOX WIDTH=\"50%\"> <tr> <td>User Name:</td><td>$user_name</td> </tr> <tr> <td width = \"50%\">Name:</td><td>$full_name</td> </tr> <tr> <td>Email Address:</td><td>$user_email</td> </tr> <tr> <td>Website:</td><td>$website</td> </tr> <tr> <td>Date Joined:</td><td>$date</td> </tr> </table><br><br>"; $i++; } } ?> </td> <td width="196" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <?php include('includes/footer.php'); ?> </body> </html>
  2. The link in the source code looks like this (break being the member's name) <a href=profile.php?ID=>break</a> Added the quotes, thanks
  3. I tried that and it's still not working properly. When I log in, I get redirected to the profile page of the member I am logged in as (.../user.php?id=54 for example), but when I try to view another member via the member list, the url looks like this /user.php?id= with nothing after the = sign. I've looked through the code numerous times but I have no idea what's wrong.
  4. Ok. And btw thank you for helping <?php include 'dbc.php'; page_protect(); $ID=$_GET['ID']; ?> <html> <head> <title>Profile Search</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php include('includes/header.php'); ?> <?php include('includes/navmain.php'); ?><br><br> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="160" valign="top"> <? if (isset($_SESSION['user_id'])) {?> <div class="myaccount"> <p><strong>My Account</strong></p> <a href="myaccount.php">My Account</a><br> <a href="mysettings.php">Settings</a><br> <a href="logout.php">Logout </a> <p>You can add more links here for users</p></div> <? } ?> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="732" valign="top"><p> </p> <h3 class="titlehdr">Profile of <? echo $member;?> </h3> <table width="80%" border="0" align="center" cellpadding="10" cellspacing="5"> <tr> <td><form name="form1" method="get" action="profile.php"> User Name: <input name="member" type="text"> <input type="submit" value="Search"> </form></td> </tr> </table> <? if (isset($_GET['msg'])) { echo "<div class=\"error\">$_GET[msg]</div>"; } ?> <p><? $query = "SELECT * FROM users WHERE user_name='$member'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if($num == 0){ echo "No results to display, please search again."; }else{ $i=0; while($i < 1){ $full_name=mysql_result($result,$i,"full_name"); $user_name=mysql_result($result,$i,"user_name"); $user_email=mysql_result($result,$i,"user_email"); $website=mysql_result($result,$i,"website"); $date=mysql_result($result,$i,"date"); echo "<table border RULES=NONE FRAME=BOX WIDTH=\"50%\"> <tr> <td>User Name:</td><td>$user_name</td> </tr> <tr> <td width = \"50%\">Name:</td><td>$full_name</td> </tr> <tr> <td>Email Address:</td><td>$user_email</td> </tr> <tr> <td>Website:</td><td>$website</td> </tr> <tr> <td>Date Joined:</td><td>$date</td> </tr> </table><br><br>"; $i++; } } ?> </td> <td width="196" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <?php include('includes/footer.php'); ?> </body> </html>
  5. Ok did that and now it's taking me to a page where there SHOULD be a profile but isn't. There is just the search box to search for a member. The end of the url is profile.php?ID=
  6. Ok here's my member list page <?php include 'dbc.php'; page_protect(); ?> <html> <head> <title>My Account</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php include('includes/header.php'); ?> <?php include('includes/navmain.php'); ?><br><br> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="14%" valign="top"> <?php if (isset($_SESSION['user_id'])) {?> <div class="myaccount" align="center"> <p align="center"><strong>My Account</strong></p> <a href="myaccount.php">My Account</a><br> <a href="mysettings.php">Settings</a><br> <a href="logout.php">Logout </a> </div> <?php } if (checkAdmin()) { /*******************************END**************************/ ?> <p align="center"> <a href="admin.php">Admin CP </a></p> <?php } ?> <p> </p> <p> </p> <p> </p></td> <td width="100%" valign="top" style="border: 2px solid #FFF"><p> </p> <h3 class="titlehdr">Player List</h3> <?php if (isset($_GET['msg'])) { echo "<div class=\"error\">$_GET[msg]</div>"; } ?> <?php echo "<table> <tr> <td>NAME</td> <td> TIMEZONE</td> <td> SERVER</td> <td> CLASS</td> <td> RACE</td> <td> AA</td> <td> LEVEL</td> <td> EPIC</td> <td> CURRENT GUILD</td> <td> WILLING TO TRANSFER SERVERS</td> </tr> <br /> "; $result = mysql_query("SELECT * FROM users WHERE looking='yes'"); while($row = mysql_fetch_array($result)) { echo "<tr><td>" . "<a href=profile.php?ID=" . $row['ID'] . ">" . $row['user_name'] . "</a>" . "</td><td>" . " " . $row['timezone'] . "</td><td>" . " " .$row['server'] . "</td><td>" . " " .$row['class'] . "</td><td>" . " " . $row['race'] . "</td><td>" . " " . $row['aa'] . "</td><td>" . " " . $row['level'] . "</td><td>" . " " . $row['epic'] . "</td><td>" . " " . $row['guild'] . "</td><td>" . " " . $row['transfer'] . "</td></tr>"; } echo "</table>"; ?> </td> <td width="12%" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <?php include('includes/footer.php'); ?> </body> </html> And here's my profile.php page <?php include 'dbc.php'; page_protect(); $member=$_GET['member']; ?> <html> <head> <title>Profile Search</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container"> <?php include('includes/header.php'); ?> <?php include('includes/navmain.php'); ?><br><br> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="main"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="160" valign="top"> <? if (isset($_SESSION['user_id'])) {?> <div class="myaccount"> <p><strong>My Account</strong></p> <a href="myaccount.php">My Account</a><br> <a href="mysettings.php">Settings</a><br> <a href="logout.php">Logout </a> <p>You can add more links here for users</p></div> <? } /*******************************END**************************/ ?> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="732" valign="top"><p> </p> <h3 class="titlehdr">Profile of <? echo $member;?> </h3> <table width="80%" border="0" align="center" cellpadding="10" cellspacing="5"> <tr> <td><form name="form1" method="get" action="profile.php"> User Name: <input name="member" type="text"> <input type="submit" value="Search"> </form></td> </tr> </table> <? if (isset($_GET['msg'])) { echo "<div class=\"error\">$_GET[msg]</div>"; } ?> <p><? $query = "SELECT * FROM users WHERE user_name='$member'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if($num == 0){ echo "No results to display, please search again."; }else{ $i=0; while($i < 1){ $full_name=mysql_result($result,$i,"full_name"); $user_name=mysql_result($result,$i,"user_name"); $user_email=mysql_result($result,$i,"user_email"); $website=mysql_result($result,$i,"website"); $date=mysql_result($result,$i,"date"); echo "<table border RULES=NONE FRAME=BOX WIDTH=\"50%\"> <tr> <td>User Name:</td><td>$user_name</td> </tr> <tr> <td width = \"50%\">Name:</td><td>$full_name</td> </tr> <tr> <td>Email Address:</td><td>$user_email</td> </tr> <tr> <td>Website:</td><td>$website</td> </tr> <tr> <td>Date Joined:</td><td>$date</td> </tr> </table><br><br>"; $i++; } } ?> </td> <td width="196" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <?php include('includes/footer.php'); ?> </body> </html>
  7. In the while statement, where I'm trying to get the username to link to the user's profile page. Right now it just takes me back to the account I'm logged in to, no matter which user I click on.
  8. That worked for the row names, thank you Any idea on making the link work?
  9. Ok basically I'm working on a members page and I want the member's username to link to their profile. I've tried a couple of different things, none of which work. It's been a long time since I've done this type of thing so I can't remember how to do it. I also only want the row names (name, timezone, server, etc) to show ONCE instead of above every member's info. Any help would be greatly appreciated. Right now when you click on the username it just takes me to the page of the member I'm currently logged in as, instead of the member I clicked on. <?php echo "<table>"; $result = mysql_query("SELECT * FROM users WHERE looking='yes'"); while($row = mysql_fetch_array($result)) { echo "<tr><td>" . "NAME" . "</td><td>" . " " . "TIMEZONE" . "</td><td>" . " ". "SERVER" . "</td><td>" . " ". "CLASS" . "</td><td>" . " ". "RACE" . "</td><td>" . " ". "AA" . "</td><td>" . " ". "LEVEL" . "</td><td>" . " ". "EPIC" . "</td><td>" . " ". "CURRENT GUILD" . "</td><td>" . " ". "WILLING TO TRANSFER SERVERS" . "</td><tr>" ."<br>"; echo "<tr><td>" . "<a href=profile.php?ID=" . $row['ID'] . ">" . $row['user_name'] . "</a>" . "</td><td>" . " " . $row['timezone'] . "</td><td>" . " " .$row['server'] . "</td><td>" . " " .$row['class'] . "</td><td>" . " " . $row['race'] . "</td><td>" . " " . $row['aa'] . "</td><td>" . " " . $row['level'] . "</td><td>" . " " . $row['epic'] . "</td><td>" . " " . $row['guild'] . "</td><td>" . " " . $row['transfer'] . "</td></tr>"; } echo "</table>"; ?>
  10. Laine

    Hiya

    Hi, my name is Laine and while I'm not a total noob to php, I'm self taught mostly so I have some gaps in my knowledge that irritate the hell out of me. I am slowly filling in the gaps and spend a lot of time Googling my mistakes! So here I am, hoping to get help/answers when I can't find them on Google.
×
×
  • 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.