Forums

PHP

This topic is locked

include files

Posted 31 Oct 2001 11:32:15
1
has voted
31 Oct 2001 11:32:15 Kacey Murphy posted:
This is kinda hard to explain but what I have is a site in dreamweaver ud4 made from one template, to create the new pages i go open from template take that template and roll with it. Inside the template are PHP include files.

< ?php include("footer.php"; ? >

Well that works all fine and dandy, but when I setup my signup page, I use the template and in one of the fields that I have editable, I design the form with the sign-in objects, i am connecting to a mySQL databse to authenticate, well all that is working fine it verifies and even takes them to the login page or the error page, the problem I am running into is when I create the Phakt authenticate query (or thingy) for the authentication it takes out my include file at the bottom of the page and replaces it with this:

< ?php include("footer.php"; ? > <-- Takes Out
< ?php echo $KT_LoginAction? > <-- Replace it with

So I say ok I will add the include file manually, so I do that. and when I save the page it turn that into a <?php echo $KT_LoginAction?> also, so I have two of them now.

Then when i upload and run it on there server it does this at the bottom of the page instead of displaying my include footer

/login.php <-- This is see-able by the user.

You can check this out @ www.p-traders.com and click sign-in and the top left. The username and password are test/test

My whole site code for the page is as follows:

< ?php


// Copyright (c) Interakt Online 2001
// www.interakt.ro/

require("./adodb/adodb.inc.php";
require("./Connections/ptraders.php";
?>< ?php
// *** Start the session
session_start();
// *** Validate request to log in to this site.
$KT_LoginAction = $PHP_SELF;
if ($QUERY_STRING!="" $KT_LoginAction .= "?".$QUERY_STRING;
if (isset($username)) {
$KT_valUsername=$username;
$KT_fldUserAuthorization="";
$KT_redirectLoginSuccess="user_login.php";
$KT_redirectLoginFailed="user_unknown.php";
$KT_rsUser_Source="SELECT user_id, user_pass ";
if ($KT_fldUserAuthorization != "" $KT_rsUser_Source .= "," . $KT_fldUserAuthorization;
$KT_rsUser_Source .= " FROM users WHERE user_id='" . $KT_valUsername . "' AND user_pass='" . $password . "'";
$KT_rsUser=$ptraders->Execute($KT_rsUser_Source) or DIE($ptraders->ErrorMsg());
if (!$KT_rsUser->EOF) {
// username and password match - this is a valid user
$KT_Username=$KT_valUsername;
session_register("KT_Username";
if ($KT_fldUserAuthorization != "" {
$KT_UserAuthorization=$KT_rsUser->Fields($KT_fldUserAuthorization);
} else {
$KT_UserAuthorization="";
}
session_register("KT_UserAuthorization";
if (isset($accessdenied) && false) {
$KT_redirectLoginSuccess = $accessdenied;
}
$KT_rsUser->Close();
session_register("KT_login_failed";
$KT_login_failed = false;
header ("Location: $KT_redirectLoginSuccess";
exit;
}
$KT_rsUser->Close();
session_register("KT_login_failed";
$KT_login_failed = true;
header ("Location: $KT_redirectLoginFailed";
exit;
}
?>

Replies

Replied 31 Oct 2001 11:36:44
31 Oct 2001 11:36:44 Kacey Murphy replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
***BUNCH OF TABLES ARE HERE (DELETED TO SHORTEN UP)****


Here is the FORM AUTHENTICATION

#BeginEditable "main_info" --&gt;
&lt; table width="450" border="0" cellspacing="0" cellpadding="3" &gt;
&lt; form name="userForm" method="post" action="&lt;?php echo $KT_LoginAction?&gt;" &gt;

**MORE TABLES WERE HERE**

&lt; /table &gt;
&lt; !-- #BeginEditable "footer" -- &gt;
&lt; ?php echo $KT_LoginAction?&gt;
&lt; ?php echo $KT_LoginAction?&gt;&lt;br&gt;

&lt; !-- #EndEditable -- &gt;
&lt; /body &gt;
&lt; !-- #EndTemplate --&gt;&lt;/html &gt;
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>


I am using a WINXP machine to create everything and Dreamweaver UltraDEV4 / My server is mySQL 3.27 (i tink) and a Linux Cobalt Raq3i with PHP 4.0.6 installed on it.

Thanks, Sincerely Kacey A. Murphy
netbuilder's, Inc

Reply to this topic