Jump to content

Define $thisname, and use it in other php document


ztealmax

Recommended Posts

Hi im having trouble getting this to work
If i define [b]define('filename',$file);[/b]
[code]<?php
// set file to read
$file = $_GET['text'];
// open file
$fh = fopen($file, 'r') /*or die('Could not open file!')*/;
// read file contents
$data = fread($fh, filesize($file)) /*or die('Could not read file!')*/;
// close file
fclose($fh);
define('filename',$file);?>
<? //open defined layout for this (WORKS)
echo $theme ;?>[/code]

And now i want to use it on another page "$theme" something like this:
[code]
<?php
$theme = ."<table><tr>
<td class='title' style='white-space:nowrap'>".filename."</td></tr></table>"; ?>
[/code]
however the defined [b]".filename."[/b] doesnt apear, what am i doing wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.