Page 1 of 1

include login page in index ,but how???

Posted: Fri Aug 18, 2006 7:00 pm
by NAT
Hi,

I am trying to include the login page in index.php . But when i login it opens in new page outside index.php. My login system is devided in two pages login.php en cheklogin.php. In login.php the code is only a form and tables, and takes the information from cheklogin.php so its like this:

Code: Select all

<form method="post" action="../testpage/cheklogin.php"> 
<p><STRONG>Name:</STRONG><br> 
<input type="text" name="name" size="25" maxlength="25"></p> 
<p><strong>Password:</strong><br> 
<input type="password" name="password" size="25" maxlength="25"></p> 
<p><input type="submit" name="submit" value="Login"></p> 
</form>

And in the cheklogin.php i have whole bunch information code, that needs to make connection with DB, session information.

Now my question is, how can i make login.php included inside the index.php? So that they work inside the index.php

Do i have to put some headers information on top of index.php?

i add it only this line in index.php where login.php must be included:

<?
include("login.php");
?>

But this is not enoughf, wat do i have to do so that login.php takes the information from cheklogin.php and includes inside index.php?

Thuse any have ideea how to do this? :?

Thanks in advance,

NAT

Posted: Fri Aug 18, 2006 8:00 pm
by Ambush Commander
I don't understand what information you're taking from cheklogin.php. However, I'd do it like this:

1. Include checklogin to determine whether or not the user is being logged in or is logged in, etc.
2. Print out page
3. Print out login form if not logged in.

Posted: Sat Aug 19, 2006 1:08 am
by RobertGonzalez
NAT, you post is a little confusing. It sounds like you have a login form that is in the login.php page. It sounds like your index.php page wants to include the login.php page. Then it sounds like you have the cheklogin.php that is processing the login. What else is it you want to do?

Posted: Sat Aug 19, 2006 11:59 am
by NAT
Everah, i think i woul the way Ambush Commander explaind. Like i sayt i have deviede the login system in 2 pages.

Login.php = only a form

Chekloginphp = its whole information, connecting wiht DB, startsession, selecting field, and md5 ecryption, so actualy evrythink thuse cheklogin.php.



I want to give a try like Ambush Commander explaind.

1) So first i have to include cheklogin.php from the top of index.php

Code: Select all

<?
include("cheklogin.php");
?>
2) What page do i have to print out?

3)Do i ahve print out twice the same page? :?

second and third partd i dontunderstand.

Posted: Sat Aug 19, 2006 11:44 pm
by RobertGonzalez
NAT wrote:Login.php = only a form

Chekloginphp = its whole information, connecting wiht DB, startsession, selecting field, and md5 ecryption, so actualy evrythink thuse cheklogin.php.

I want to give a try like Ambush Commander explaind.

1) So first i have to include cheklogin.php from the top of index.php

Code: Select all

<?
include("cheklogin.php");
?>
2) What page do i have to print out?

3)Do i ahve print out twice the same page? :?

second and third partd i dontunderstand.
2) Print out the page the user needs to see. If it is a form, show the form. Otherwise show what they should see.
3) Not unless the user needs to see the same page twice.