ztealmax Posted December 28, 2006 Share Posted December 28, 2006 hi im using include to target a specific table as shown below:my [b]index.php[/b][code]<? include("menus/mainmenu.php");?><? echo $HEADER ?><table><tr><td><?phpif(isset($_GET['content'])){include($_GET['content'].".php");} else {echo " ";}?>[/code]</td></tr></table>this is my read code:[code]<?php$file = $_GET['text'];$fh = fopen($file, 'r');$data = fread($fh, filesize($file));fclose($fh); ?> <? echo $file;?> <pre><? echo $data;?></DIV></pre><? echo lan_10 . date ("F d Y H:i:s.", filemtime($file)); ?>[/code]I use [b]read.php?text=news/titleoffile.txt[/b] to open for readingWhat i am having problem is how to make a workable link so it includes it in table on index.php file you saw ontop of my postuseally i would use for a single php file this:[code]<a href="<?=$_SERVER['PHP_SELF']?>?target=members">Members</a>[/code] that would open the file[i]members.php[/i] in this area of [i]index.php[/i] [code]<?phpif(isset($_GET['content'])){include($_GET['content'].".php");} else {echo " ";}?>[/code] SO my question is how can i make it open if i have a file like mine that opens one more file for reading? as shown here: [code]<a href="read.php?text=news/<?php print($value["name"]);?>" target="content"><?php print($value["name"]);?></a>[/code]/Thanx for all helpMartin Link to comment https://forums.phpfreaks.com/topic/32013-solved-target-the-table-using-problem/ Share on other sites More sharing options...
ztealmax Posted December 28, 2006 Author Share Posted December 28, 2006 can any one sove this? Link to comment https://forums.phpfreaks.com/topic/32013-solved-target-the-table-using-problem/#findComment-148709 Share on other sites More sharing options...
craygo Posted December 28, 2006 Share Posted December 28, 2006 From what I see you have a couple things wrong.first you are looking for $_GET['content'], there is not variable called content in your link[code]<?phpif(isset($_GET['content'])){include($_GET['content'].".php");} else {echo " ";}?>[/code]So your link would be something like so[code]<a href="<?=$_SERVER['PHP_SELF']?>?content=read&text=news/<?php print($value["name"]);?>"><?php print($value["name"]);?></a>[/code]Ray Link to comment https://forums.phpfreaks.com/topic/32013-solved-target-the-table-using-problem/#findComment-148737 Share on other sites More sharing options...
ztealmax Posted December 28, 2006 Author Share Posted December 28, 2006 thank you ill try it, and if i dont get it working i get back :) Link to comment https://forums.phpfreaks.com/topic/32013-solved-target-the-table-using-problem/#findComment-148844 Share on other sites More sharing options...
ztealmax Posted December 28, 2006 Author Share Posted December 28, 2006 Worked like a charm :D much apriciated thank you//Martin Link to comment https://forums.phpfreaks.com/topic/32013-solved-target-the-table-using-problem/#findComment-148995 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.