Hi guys
I’ve got a login script that passes the username to a profile page if a successful login. The profile page says Welcome “username”
That’s all working perfectly
What I need help with now tho, is I use dreamweaver to create my websites and with that I need to create a recordset on the profile to pull the details of my customer based on the session “username” as the filter, this is turn should produce a dynamic table and allow the view of the PDF files of their estimate and invoices to which are stored in the Dbase.
Here is the code from the profile page
[php]<?php require_once('../Connections/new.php'); ?>
<?php $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $colname_Recordset1 = "1"; if (isset($_SESSION['$login_session'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['$login_session'] : addslashes($_SESSION['$login_session']); } mysql_select_db($database_new, $new); $query_Recordset1 = sprintf("SELECT * FROM login WHERE username = '%s'", $colname_Recordset1); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $new) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; $colname_Recordset1 = "1"; if (isset($_SESSION['<?php echo $login_session; ?>‘])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION[’<?php echo $login_session; ?>’] : addslashes($_SESSION[’<?php echo $login_session; ?>’]); } mysql_select_db($database_new, $new); $query_Recordset1 = sprintf(“SELECT * FROM login WHERE username = ‘%s’”, $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $new) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?>
<?php include('session.php'); ?> Your Home Pageid | username | password |
<?php echo $row_Recordset1['id']; ?> | <?php echo $row_Recordset1['username']; ?> | <?php echo $row_Recordset1['password']; ?> |
When I run it at the moment, it returns blank fields for the records. I must be doing something wrong in terms of re-using the session within dreamweaver
The site can be found at http://scotair.noip.me