Jump to content

[SOLVED] no data populating the page


newphy4now

Recommended Posts

Hi, i am creating a Memebers Only website and i'm not sure if i have an error in coding when connecting to the database. The php file verifies login information which it does perfectly - then redirects to the members page.

 

The members page connects to a table in my database and populates the page with the members profile data that is associated with the login info entered. IT IS NOT DOING THIS.

There is no data populating the page. Please look at my code below and let me know if i am missing any vital code. Thank you sooooooooo much!!!

 

The PHP file:

<?
session_start();

//**connection data goes in here**

$query = "SELECT * FROM prof_pass WHERE user='$puser' AND pass='$ppassword'";

$result= mysql_query($query)
or die ("unable to retrieve database info");
$nrows=mysql_num_rows($result);

if ($nrows > 0) {
$_SESSION['auth']="yes";
$_SESSION['logname']= $user;                     //<---input by user
while ($row = mysql_fetch_array($result))
  {
extract($row);
$clientN = $clientNumber;             
$_SESSION['client']= $clientN;                      //<----data from row
}
header("Location: http://testingsite3.com/companyname3/code/PROF_PROFILE_TEST.php");
exit;
}
else
{
header("Location: http://testingsite1.com/companyname1/login_error.html");
exit;

}
?>

Now for the members page: PROF_PROFILE_TEST.php ...

 

<?
session_start();
if (@$_SESSION['auth']!="yes")
{
header("Location: ../account_login.html");
exit();
}

//**connection data goes in here**

$query = "SELECT * FROM Proffesional_list WHERE clientNumber='$clientN'";  //<---is this not the session variable ?

$result= mysql_query($query)
or DIE("unable to retrieve database info");

  while ($row = mysql_fetch_array($result))
  {
          extract($row);
    echo "<div width='98%'>
    <table width='45%' style='float:left' class='topprofiletable'>
    <tr><td><span class='busname'>$business: </span>    ID: 1234567890 </td></tr>
    <tr><td>$streetAddress, $city, $province, $postalc</td></tr>
    <tr><td><b><font color='0000ff'>$salut1 $firstName1 $lastName1</font><b></td></tr>
    <tr><td style='float:left' class='item'>Industry:</td><td style='float:right'>$industry</td></tr>
    <tr><td style='float:left' class='item'>Contact:</td><td style='float:right'>$contactNumber</td></tr>
    <tr><td style='float:left' class='item'>Email:</td><td style='float:right'>$eMail1</td></tr>
    <tr><td style='float:left' class='item'>Fax:</td><td style='float:right'>$fax</td></tr>
    <tr><td style='float:left' class='item'>Website:</td><td style='float:right'>$webAddress</td></tr>
    <tr><td style='float:left'> </td></tr>
    </table>
}
?>

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.