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
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???

 

Link to comment
Share on other sites

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");
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.