dniwebdesign
01-10-2004, 07:18 AM
//Data File
//© 2004 DNI Web Design
//http://www.dniwebdesign.ca.tt
<?php
session_start();
include 'home/sites/site58/users/dnidesign/web/clientarea/config.php';
$result=mysql_query("SELECT * from dnidesign_clients where username='".$_SESSION['account']."' and password='".$_SESSION['password']."'",$connection) or print mysql_error();
if(mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$account=$row["account"];
$password=$row["password"];
$firstname=$row["firstname"];
$lastname=$row["lastname"];
$company=$row["company"];
$address1=$row["address1"];
$address2=$row["address2"];
$town=$row["town"];
$province=$row["province"];
$postalcode=$row["postalcode"];
$country=$row["country"];
$phone=$row["phone"];
$fax=$row["fax"];
$email=$row["email"];
$website=$row["website"];
$paid=$row["paid"];
$balance=$row["balance"];
$_SESSION["account"] = $account;
$_SESSION["password"] = $password; // Register session key with the value
$_SESSION["firstname"] = $firstname; // Register session key with the value
$_SESSION["lastname"] = $lastname; // Register session key with the value
$_SESSION["company"] = $company; // Register session key with the value
$_SESSION["address1"] = $address1; // Register session key with the value
$_SESSION["address2"] = $address2; // Register session key with the value
$_SESSION["town"] = $town; // Register session key with the value
$_SESSION["province"] = $province; // Register session key with the value
$_SESSION["postalcode"] = $postalcode; // Register session key with the value
$_SESSION["country"] = $country; // Register session key with the value
$_SESSION["phone"] = $phone; // Register session key with the value
$_SESSION["fax"] = $fax; // Register session key with the value
$_SESSION["email"] = $email; // Register session key with the value
$_SESSION["website"] = $website; // Register session key with the value
$_SESSION["paid"] = $paid; // Register session key with the value
$_SESSION["balance"] = $balance; // Register session key with the value
}
}
?>
<?php include "data.php"; ?>
...
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td valign="top" bgcolor="#CCCCCC"><table width="26%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="3"><b><i>Mailing Information</i></b></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['company'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2">c/o <? echo $_SESSION['firstname'] ?> <? echo $_SESSION['lastname'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['address1'] ?> <? echo $_SESSION['address2'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['town'] ?>, <? echo $_SESSION['province'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['postalcode'] ?> <? echo $_SESSION['country'] ?></font></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
Okay for some strange reason this doesn't work. Why I don't know, however it registeres the account and password (from the form to login) and it registers the firstname and last name. Even if I remove the $_SESSION["firstname"]= $firstname; (both this and lastname) it still prints the info. However the other info doesn't print. Can anyone notice what I am doing wrong. I know I am connecting right, or else I wouldn't be able to get into the page.
My page is on a SSL server (https://) and are located in frames. Does any of these play a role in the problem?
//© 2004 DNI Web Design
//http://www.dniwebdesign.ca.tt
<?php
session_start();
include 'home/sites/site58/users/dnidesign/web/clientarea/config.php';
$result=mysql_query("SELECT * from dnidesign_clients where username='".$_SESSION['account']."' and password='".$_SESSION['password']."'",$connection) or print mysql_error();
if(mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$account=$row["account"];
$password=$row["password"];
$firstname=$row["firstname"];
$lastname=$row["lastname"];
$company=$row["company"];
$address1=$row["address1"];
$address2=$row["address2"];
$town=$row["town"];
$province=$row["province"];
$postalcode=$row["postalcode"];
$country=$row["country"];
$phone=$row["phone"];
$fax=$row["fax"];
$email=$row["email"];
$website=$row["website"];
$paid=$row["paid"];
$balance=$row["balance"];
$_SESSION["account"] = $account;
$_SESSION["password"] = $password; // Register session key with the value
$_SESSION["firstname"] = $firstname; // Register session key with the value
$_SESSION["lastname"] = $lastname; // Register session key with the value
$_SESSION["company"] = $company; // Register session key with the value
$_SESSION["address1"] = $address1; // Register session key with the value
$_SESSION["address2"] = $address2; // Register session key with the value
$_SESSION["town"] = $town; // Register session key with the value
$_SESSION["province"] = $province; // Register session key with the value
$_SESSION["postalcode"] = $postalcode; // Register session key with the value
$_SESSION["country"] = $country; // Register session key with the value
$_SESSION["phone"] = $phone; // Register session key with the value
$_SESSION["fax"] = $fax; // Register session key with the value
$_SESSION["email"] = $email; // Register session key with the value
$_SESSION["website"] = $website; // Register session key with the value
$_SESSION["paid"] = $paid; // Register session key with the value
$_SESSION["balance"] = $balance; // Register session key with the value
}
}
?>
<?php include "data.php"; ?>
...
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td valign="top" bgcolor="#CCCCCC"><table width="26%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="3"><b><i>Mailing Information</i></b></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['company'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2">c/o <? echo $_SESSION['firstname'] ?> <? echo $_SESSION['lastname'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['address1'] ?> <? echo $_SESSION['address2'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['town'] ?>, <? echo $_SESSION['province'] ?></font></td>
</tr>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2"><? echo $_SESSION['postalcode'] ?> <? echo $_SESSION['country'] ?></font></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
Okay for some strange reason this doesn't work. Why I don't know, however it registeres the account and password (from the form to login) and it registers the firstname and last name. Even if I remove the $_SESSION["firstname"]= $firstname; (both this and lastname) it still prints the info. However the other info doesn't print. Can anyone notice what I am doing wrong. I know I am connecting right, or else I wouldn't be able to get into the page.
My page is on a SSL server (https://) and are located in frames. Does any of these play a role in the problem?