PDA

View Full Version : parsing variables in custom php page


EWGF
04-05-2009, 11:12 AM
Stuggling to insert a whole page into the php page instead of referring to templates. I got the $legend working, but the $copy won't get parsed.

I'm guessing $copy cannot be parsed inside $legend, but I'm quite new on this. Can someone explain what's wrong with this and give a solution for this. Thanks :)

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'legend');

// ######################### REQUIRE BACK-END ############################
$curdir = getcwd();
chdir('/home/**********/htdocs/www/forum');
require_once('./global.php');
chdir($curdir);

// ######################## START MAIN SCRIPT ############################

$copy = $vbulletin->options['homeurl'];

$legend .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="nl">
<head>
<title>Legend</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>

<table class="table" cellpadding="0" cellspacing="0" border="0">
<tr><td class="title" style="padding:6px">Controll</td></tr>
<tr><td class="controll"></td></tr>
</table>

<div>$copy</div>

</body>
</html>';

eval('print_output("$legend");');

?>

Lynne
04-05-2009, 03:11 PM
Are you getting anything in your error_logs? (If you don't know where they are, you should ask your host.)

EWGF
04-05-2009, 03:22 PM
No error at all. $copy just shows up as $copy in the browser.

Lynne
04-05-2009, 03:40 PM
Try something like:

<div>' . $copy . '</div>

EWGF
04-05-2009, 03:48 PM
Miss, you are a hero!:)

Do you btw know a site which explains more about the use of those dots and stuff?

Lynne
04-05-2009, 04:17 PM
Not really. I've learned everything I know through trial and error. Lots of errors.... lots and lots and lots of them! :)