runnerjp Posted March 8, 2007 Share Posted March 8, 2007 hey guys, ok i got this scipt puts the content on my page... i have added this to the body.php ( all will become clear in a min) if (file_exists($content)) { include($content); } else {?> so how would i add $content= to if($auth[error]) { include("include/index.inc.php"); } else { include("include/index.log.php"); } some how to show the different pages as content? here is my index file if it will help <? // File ID: index.php (main page for profile site) include("require/config.php"); require("require/authmember.php"); $auth=authenticate($login, $password); include("include/get_config.inc.php"); [color=red]$content=if($auth[error]) { include("include/index.inc.php"); } else { include("include/index.log.php"); }[/color] if ($auth[error]) {$menu="include/menu_u.inc.php";} else {$menu="include/menu_v.inc.php";} include("include/header.inc.php"); include("include/body.inc.php"); //include("include/footer.inc.php"); ?> Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/ Share on other sites More sharing options...
runnerjp Posted March 8, 2007 Author Share Posted March 8, 2007 wud this be about right>> $content = ($auth[error]) include("include/index.inc.php") else include("include/index.log.php"); still not 100% Parse error: syntax error, unexpected T_INCLUDE Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/#findComment-202701 Share on other sites More sharing options...
Barand Posted March 8, 2007 Share Posted March 8, 2007 If you want the ternary operator $content = ($auth[error]) ? 'include("include/index.inc.php")' : 'include("include/index.log.php")'; Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/#findComment-202855 Share on other sites More sharing options...
runnerjp Posted March 8, 2007 Author Share Posted March 8, 2007 ok all im getting with the new statement is it saying 'include("include/index.inc.php") Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/#findComment-202997 Share on other sites More sharing options...
Barand Posted March 8, 2007 Share Posted March 8, 2007 $content = ($auth[error]) ? "include/index.inc.php" : "include/index.log.php"; include $content; Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/#findComment-203022 Share on other sites More sharing options...
runnerjp Posted March 9, 2007 Author Share Posted March 9, 2007 ok that works but it repeats it 2wise www.runnerselite.com <? // File ID: index.php (main page for profile site) include("require/config.php"); require("require/authmember.php"); $auth=authenticate($login, $password); include("include/get_config.inc.php"); $content = ($auth[error]) ? "include/index.inc.php" : "include/index.log.php"; include $content; if ($auth[error]) {$menu="include/menu_u.inc.php";} else {$menu="include/menu_v.inc.php";} include("include/header.inc.php"); include("include/body.inc.php"); //include("include/footer.inc.php"); ?> here is body <table width="100%" summary="body"> <tr> <td width="15%" height="96" align="left" valign="top"><center> <?include("include/info.inc.php"); ?> </center> <?include("$menu");?></td> <td width="1%" align="left" valign="top" bgcolor="#FFFFFF"><div id="linedown"> <img src="http://www.runnerselite.com/images/linedown.jpg" alt="linedown" /> </div></td> <td width="84%" align="left" valign="top"><? if (file_exists($content)) { include($content); } else {?> <?echo $content;?> </p> <?} ?> </td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/41789-solved-what-fi-statement-need-help/#findComment-203301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.