Jump to content

any help changing this code


runnerjp

Recommended Posts

hey guys

$auth=authenticate($login, $password);
include("include/get_config.inc.php");
$content="include/index.inc.php";
if ($auth[error]) {$menu="include/menu_u.inc.php";} else {$menu="include/menu_v.inc.php";}

 

how could i change that code so that when a user is loged in it shows 1 page beeing the index.inc.php and when they are logged in it will show anouther like main index page??? and what would i call that index page

 

cheers

Link to comment
https://forums.phpfreaks.com/topic/41761-any-help-changing-this-code/
Share on other sites

does this sound right

 

 

if($auth[error]) { include("include/index_index.inc.php"); }
           else { include("include/index.log.php"); } ?>

 

 

so if($auth[error])  should see if they are logged in and if not send them to index.inc and if the are (else) sends them to right page???

 

ok i get an error 

 

Parse error: syntax error, unexpected T_IF in /home/runnerse/public_html/index.php on line 10

 

 

think iv left something out sum where

 

 

<?
// 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=if($auth[error]) { include("include/index.inc.php"); }
            else { include("include/index.log.php"); } 
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");
?>

ok

 

 

this is index.inc

<table width="100%" summary="maincontent">
  <tr>
    <td align="left" valign="top" bgcolor="#FFFFFF"><h1 align="left"><img src="../images/runner.jpg" alt="runner" width="127" height="155" align="left"/></h1>
        <h1 align="center"><u> Welcome Back To RunnersElite!</u></h1>
     <center>        
         <?
            include("include/adminerr.inc.php");
            if($auth[error]) { include("include/messages/index_unverified.inc.php"); }
            else { include("include/messages/index_verified.inc.php"); } ?>
      
       <p> </p>
       <p> </p>
       <p>  </p>
     </center>

      <center>
        <a href="../register.php"><img align="middle" src="../images/bemem.gif" alt="signup" width="280" height="250" border="0" /></a>
    </center>   </td>
    <td align="left" valign="top"><?include("include/loginbox.inc.php"); ?></td>
  </tr>
</table>

auth member

 

<?
function authenticate ($login, $password) {
global $db_name, $tbl_members, $incpath;
include("$incpath/error.inc.php");
$valid = mysql_fetch_array(mysql_db_query($db_name, "SELECT * FROM $tbl_members WHERE login='$login'"));
if ($login) {
if ($password ==  crypt($valid[password], $login)) {
if ($valid[enabled] ==  "yes") {
$result=$valid;
} else {
$result[error]=$strError700;}
} else {
$result[error]=$strError800;}
} else {
$result[error]=$strError200;}
return $result;
}
?>

 

thats large bits oh and 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>

 

 

is it something to do with this tho

 

$content=if($auth[error]) { include("include/index.inc.php"); }
            else { include("include/index.log.php"); } 
if ($auth[error]) {$menu="include/menu_u.inc.php";} else {$menu="include/menu_v.inc.php";}

is content=if orrect

ok after messing around with it i have fixed it

 

<?
// 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");
if($auth[error]) { include("include/index.inc.php"); }
            else { include("include/index.log.php"); } 
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");
?>

but this means that the index.inc and index.log does not appear in the body where the content is supposed to appear how comes... do i have to set it as content?

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.