CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Pass Session GroupID to non CCS php page

Print topic Send  topic

Author Message
pbrad

Posts: 58
Posted: 03/15/2008, 2:58 PM

Hi,

I have successfully adapted the Sothink DHTML menu to operate in MySQL PHP project with multiple levels of submenus which opens up all kinds of design options. The Header file calls a PHP page:

<script src="/js/DHTMLMenu.php" type="text/javascript"></script> for the actual configuration and population of the menu.

The problem that i have is that I want to filter the visible menu items based on the users session GroupID which is not available to me on this non ccs page. Is there any way for me to pass the GroupID variable to this page as some kind of Global Variable from a CCS page?

<?
$dbhost = "localhost"; // DB Host name
$dbusername = "xxx"; // DB User
$dbpass = "xxx"; // DB User password
$dbname = "xxx"; // DB Name
$query = "select * from menu_items_r where GroupID = $CCSGroupID" ; (<--- Need to access $CCSGroupID in this page)
$connection = mysql_connect($dbhost, $dbusername, $dbpass);
$resultCat = mysql_db_query($dbname, $query);
$numrowsCat = mysql_num_rows($resultCat);

for ($i = 0; $i < $numrowsCat; $i++)
{
$rowCat = mysql_fetch_array($resultCat);
$R1Name = $rowCat["Name"];
?>

Thanks for any help offered,

Pete


_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message
datadoit
Posted: 03/15/2008, 2:27 PM

GroupID is also a session var, so you should be able to do:

$query = "select * from menu_items_r where GroupID = '" .
$_SESSION['GroupID'] . "'" ;
DonP
Posted: 03/15/2008, 2:58 PM

As a long time user of both DHTMLMenu and CCS, I always use pure CCS
code in it rather than starting over with a new connection and code.
That way you can use the same CCS functions that you're used it.
However, to do so, it is necessary to call the menu as an object so I
set a label to HTML and add a Before Show event like this:

ob_start();
include("./menu/popup/help_popup.js");
$contents = ob_get_contents();
ob_end_clean();
$PageMenu->SetValue("<script type=\"text/javascript\">" . $contents .
"</script>");

It seems to work only with a relative path rather than an absolute path.

Don (DonP)

pbrad wrote:
> Hi,
>
> I have successfully adapted the Sothink DHTML menu to operate in MySQL PHP
> project with multiple levels of submenus which opens up all kinds of design
> options. The Header file calls a PHP page:
>
> <script src="/js/DHTMLMenu.php" type="text/javascript"></script> for the actual
> configuration and population of the menu.
>
> The problem that i have is that I want to filter the visible menu items based
> on the users session GroupID which is not available to me on this non ccs page.
> Is there any way for me to pass the GroupID variable to this page as some kind
> of Global Variable from a CCS page?
>
> <?
> $dbhost = "localhost"; // DB Host name
> $dbusername = "xxx"; // DB User
> $dbpass = "xxx"; // DB User password
> $dbname = "xxx"; // DB Name
> $query = "select * from menu_items_r where GroupID = $CCSGroupID" ; (<---
> Need to access $CCSGroupID in this page)
> $connection = mysql_connect($dbhost, $dbusername, $dbpass);
> $resultCat = mysql_db_query($dbname, $query);
> $numrowsCat = mysql_num_rows($resultCat);
>
> for ($i = 0; $i < $numrowsCat; $i++)
> {
> $rowCat = mysql_fetch_array($resultCat);
> $R1Name = $rowCat["Name"];
> ?>
>
> Thanks for any help offered,
>
> Pete
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
pbrad

Posts: 58
Posted: 03/15/2008, 4:15 PM

Excellent, that worked perfectly.

Thanks for the help.

Pete
_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message
pbrad

Posts: 58
Posted: 03/15/2008, 4:15 PM

Excellent, that worked perfectly.

Thanks for the help.

Pete
_________________
Pete

CCS 4
MySQL
PHP
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.