Thanks misty - I think all customers have to be members with this mod. I require customers categorised into members and non-members.
thanks fairestcape once again for the offer of releasing some of Scott's work should he be in agreement. I may pursue this route, but I have made some progress with the php coding.
This the code:
<?php
$custID = $_SESSION['customer_id'];
if ($custID > 0)
{
$host="localhost";
$user="username";
$password="password";
$database="database name";
$connection = mysql_connect($host, $user, $password)
or die ("Could not connect");
$db = mysql_select_db($database, $connection)
or die ("Could not connect");
$query = "SELECT customers_firstname, customers_lastname, customers_id, customers_newsletter from customers WHERE customers_id=$custID";
$result = mysql_query($query)
or die ("couldn't execute query");
$row = mysql_fetch_array($result,MYSQL_BOTH);
$newlettercode = $row[3];
if ($newlettercode == 0)
{echo "non member - please purchase membership subscription above";}
else
{echo "link to members section";}
}
else
{ echo "<br>Please log in if you are a member<br> ";}
?>
If it of use to anyone - please copy
Basically it checks the sesion variable $_SESSION['customer_id']; which is null if no-one is signed in - or contains the customer_id if signed in.
The program also checks the newsletter field for that customer and if set to 1 allows entry to the members area, if set to 0 suggests buying a members subscription and disallows access.
I've checked it out a few times with my dummy database and it seems to work ok.
I have used this on the Define Pages Editor/define_main_page.php
file - I now need to look at combining the graphics with the code
thanks again
Derek



