I have a CMSMS website where i need to use some vars in an included php file.
this UDT {get_url_data} i use on top of the template:
Code: Select all
$gCms = cmsms();
session_start();
error_reporting(E_ALL);
$card_id = $_SESSION['card_id'] ;
$url = $_SERVER['REQUEST_URI'];
list($page, $lang, $subpagina) = explode("/", $url);
$smarty = &$gCms->GetSmarty();
$smarty->assign('lang', $lang);
$smarty->assign('subpagina', $subpagina);
$smarty->assign('card_id2', '$card_id');
include 'consument/lang/'.$lang.'.php';
If i put {$lang} or {$subpagina}, then i get the correct value in the content ($lang = nl and $subpagina = client), so the UDT is working.
next i use an UDT to include the php file:
Code: Select all
include ('consument/index.php');
this include file is lokking for 2 things at first before going further, if there is a $card_id and if $subpagina = 'client'.
this include file looks like this:
Code: Select all
<?
if ( (!$card_id) && ($subpagina <> "client") ) { echo "$lang_nietingelogd<br><br><a href=\"javascript:history.go(-1)\"><< $lang_terug</a>" ; } else {
if (($_SESSION['user_level'] == "2") && ($subpagina <> "client") ) { } else {
if ( ((!$card_id) && ($subpagina == "client")) || ($_SESSION['user_level'] <> "1") ) {
include ('consument/loginform.php');
} else { if ($subpagina == "client") {
$card_id = $_SESSION['card_id'] ;
include 'consument/db.php';
$result = mysql_query("select * from dbo_b_fidcard where card_id = '$card_id'");
$row = mysql_fetch_assoc($result);
echo "<br><br>
$lang_welcome $row[first_name] $row[last_name], <br><br>
<p align=\"center\"><strong>$lang_pointsbox_1</strong></p>
<br>
<br>
<p align=\"center\"><a href=\"index.php/$lang/your_pass\"><img src=\"../2009/uploads/images/afbeelding.png\" width=\"150\" height=\"24\" /></a>
</p>
" ; } } } }
?>
I only get << on the screen from the first 'echo'.
How can i pass these variables to the include php file en so let the php file work.
Hope someone knows this
Kind regards
Peter