i2-Services, Inc. Forums

Full Version: How To Tip:  Placing a login on the front page of your site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For those of you looking to add a login / logged in box to the front of your site follow these steps:

1)  First your index page needs to be index.php

2) Add to the very top of the index.php file (no blank lines at the top). Make sure the path in the quotes is to the correct installation folder.

Code:
<?php
require_once("install_folder/login_require.php");
?>

3) Add this line where you would like the login box to be displayed. Be sure to again have the correct path to the install folder --> /interface/

Code:
<? include("install_folder/interface/login_box.php") ?>

4) Make a few modifications to the "/interface/login_box.php" file to correctly link the form action to the control_panel.php file & the redirect path:

This includes:

Code:
      <form action=\"/install_folder/control_panel.php\" method=\"post\">

&

Code:
<input type=\"hidden\" name=\"redirect\" value=\"/protected_folder/\">

Lastly you can customize the HTML to configure the login box to match your site design.

Note: View Screen Shot Attachment

Thats it!
i2
thanx alot, how would i go about putting a registration form on the front of my page, tried placing the code from the form in but it was all encoded?
Which file is encoded?
register.php
Oh I see. If you want to add the registration form, and just form is what you would be addiing copy the source from the output of register.php.

register.php is part of the program that needs to be ran. Your index file can not do the entire registration process but you can host the form there.

Which after submission will move you from your index to the register.php URL / Form to display any form errors or account created messages.
dont know y i didnt think of that thanx alot
Reference URL's