ztealmax Posted December 29, 2006 Share Posted December 29, 2006 Hi im having trouble getting this to workIf 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? Link to comment https://forums.phpfreaks.com/topic/32141-define-thisname-and-use-it-in-other-php-document/ Share on other sites More sharing options...
fert Posted December 29, 2006 Share Posted December 29, 2006 you need to include the file into the other file with include or require Link to comment https://forums.phpfreaks.com/topic/32141-define-thisname-and-use-it-in-other-php-document/#findComment-149166 Share on other sites More sharing options...
ztealmax Posted December 29, 2006 Author Share Posted December 29, 2006 ok thats a problem :(couse i have in my index file included theme..workingand from index file included menu..workingand from menu i call the news.php and from that i want the title to theme Link to comment https://forums.phpfreaks.com/topic/32141-define-thisname-and-use-it-in-other-php-document/#findComment-149173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.