Jump to content

Creating Page that only Paying Customers can see.


EscalateSEO

Recommended Posts

I am trying to make this page so that it is only visible to people who are logged in and have active packages for package ID's 1 and 2. You can see the bold part of the code below to see what I added.

 

<?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$pagetitle = $_LANG['clientareatitle'];
$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';
$breadcrumbnav .= ' > <a href="plr.php">PLR Products</a>'; 

initialiseClientArea($pagetitle,'',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
if ($_SESSION['uid']) {

 # User is logged in - put any code you like here

 # Here's an example to get the currently logged in clients first name

 $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']);
 $data = mysql_fetch_array($result);
 $clientname = $data[0];
 $smartyvalues["clientname"] = $clientname;

} else {

 # User is not logged in

}

# Define the template filename to be used without the .tpl extension

$templatefile = "plr"; 

outputClientArea($templatefile);

?><?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$breadcrumbnav .= '<strong>Here is some info about this page.</strong>'; 

initialiseClientArea('','',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
if ($_SESSION['uid']) {

 # User is logged in - put any code you like here

 # Here's an example to get the currently logged in clients first name

 $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']);
 $data = mysql_fetch_array($result);
 $clientname = $data[0];
 $smartyvalues["clientname"] = $clientname;

} else {

 # User is not logged in

}

# Define the template filename to be used without the .tpl extension

$templatefile = "plr"; 

outputClientArea($templatefile);

?><?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$pagetitle = $_LANG['clientareatitle'];
$breadcrumbnav .= '<strong>InvisionProfits has over 100,000 PLR products available for you to download!</strong>'; 

initialiseClientArea('','',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
[b]if ($_SESSION['uid']) {

$query = "SELECT packageid, domainstatus FROM tblhosting WHERE userid=".$_SESSION['uid']." AND packageid IN ('1','2')";

$result = mysql_query($query);

$good = false;

while($row = mysql_fetch_array($result))

{

if ($row['domainstatus'] == "Active"){

$good = true;

}
} # To assign variables in Smarty use the following syntax.
# This can then be used as {$variablename} in the template
$smartyvalues["hasauth"] = $good;

# Define the template filename to be used without the .tpl extension
$templatefile = "plr";

outputClientArea($templatefile);
?>[/b]

 

However, this code is giving the following error and I have tried everything to figure out what's going on with it:

 

Parse error: syntax error, unexpected $end in /home/invision/public_html/portal/plr.php on line 132

 

Any idea what's going on or what I need to change? Any help would be greatly appreciated!

Link to comment
Share on other sites

Missing and } at the end for the if statement ;)

 

<?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$pagetitle = $_LANG['clientareatitle'];
$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';
$breadcrumbnav .= ' > <a href="plr.php">PLR Products</a>'; 

initialiseClientArea($pagetitle,'',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
if ($_SESSION['uid']) {

 # User is logged in - put any code you like here

 # Here's an example to get the currently logged in clients first name

 $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']);
 $data = mysql_fetch_array($result);
 $clientname = $data[0];
 $smartyvalues["clientname"] = $clientname;

} else {

 # User is not logged in

}

# Define the template filename to be used without the .tpl extension

$templatefile = "plr"; 

outputClientArea($templatefile);

?><?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$breadcrumbnav .= '<strong>Here is some info about this page.</strong>'; 

initialiseClientArea('','',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
if ($_SESSION['uid']) {

 # User is logged in - put any code you like here

 # Here's an example to get the currently logged in clients first name

 $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".(int)$_SESSION['uid']);
 $data = mysql_fetch_array($result);
 $clientname = $data[0];
 $smartyvalues["clientname"] = $clientname;

} else {

 # User is not logged in

}

# Define the template filename to be used without the .tpl extension

$templatefile = "plr"; 

outputClientArea($templatefile);

?><?php

define("CLIENTAREA",true);
//define("FORCESSL",true); # Uncomment to force the page to use https://

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$pagetitle = $_LANG['clientareatitle'];
$breadcrumbnav .= '<strong>InvisionProfits has over 100,000 PLR products available for you to download!</strong>'; 

initialiseClientArea('','',$breadcrumbnav);

# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.

$smartyvalues["variablename"] = $value; 

# Check login status
if ($_SESSION['uid']) 
{
 $query = "SELECT packageid, domainstatus FROM tblhosting WHERE userid=".$_SESSION['uid']." AND packageid IN ('1','2')";

 $result = mysql_query($query);

 $good = false;

 while($row = mysql_fetch_array($result))
 {
   if ($row['domainstatus'] == "Active")
   {
     $good = true;
   }
 } 

 # To assign variables in Smarty use the following syntax.
 # This can then be used as {$variablename} in the template
 $smartyvalues["hasauth"] = $good;

 # Define the template filename to be used without the .tpl extension
 $templatefile = "plr";

 outputClientArea($templatefile);
[b]} #<----  Missing this brace[/b]
?>

Link to comment
Share on other sites

  • 4 months later...

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated