i2-Services, Inc. Forums

Full Version: Login from index.php / Customizing from the interface folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Forgive me if this is covered elsewhere. I have looked and have not found anything. I have two things in this post, Im sure these are both really easy... Im just kinda dumb =) ..

1. I want a login from index.php to /secure/secure/index.php

2. Customizing from the interface folder ... when I do this Im clearly not doing it right.... I am cutting and pasting all of the code in a specific file (in the interface folder) and putting it in my layout .. I resave it under the same name... (I am doing this in dreamweaver 8) .. it seems simple.. though when I upload it... its not right... (I have a screen shot of what I am getting) can you give a more dumbed down detailed explanation or even a tutorial to help me with this?
You should do this.  Within your index.php file (guessing this for the index of the entire site?)

At the very top add this:

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


Make sure the path is correct.  Should be "install_folder/login_require.php"

Then where you want the login box add:

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


This will include the login box which you can customize as you want by editing  the "login_box.php" template in the /interface/ folder.

It's a good start..... though makes a user sign in again ... it takes me to /secure/control_panel.php?redirect=/secure/secure/index.php

.. I want it to take me to
/secure/secure.index.php

Thanks...

i2-Services, Inc. Wrote:
You should do this. Within your index.php file (guessing this for the index of the entire site?)

At the very top add this:

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


Make sure the path is correct. Should be "install_folder/login_require.php"

Then where you want the login box add:

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


This will include the login box which you can customize as you want by editing the "login_box.php" template in the /interface/ folder.

Need to see this in action. If you want to post the URL you're working with and a test account I'll check it out.

Or you can supply those details within a ticket and we'll update this post later.
Here is the link

http://www.rea-reaa.org/index.php


i2-Services, Inc. Wrote:
Need to see this in action. If you want to post the URL you're working with and a test account I'll check it out.

Or you can supply those details within a ticket and we'll update this post later.

You have within the form to /form code:

<input type="hidden" name="redirect" value="/secure/interface/login_box.php">

Make that the correct path to where you wish to go.
Ok, I see that.. but its not like that in the code...

Im sorry Im a total doof .. =) ..

Here is the code..

Code:
<?php

////////////////////////////////////////////////////////////////////////////////////////////////////
// User Logged In --> Show Logged in Table
////////////////////////////////////////////////////////////////////////////////////////////////////

if($_SESSION[email_address] && $_SESSION[pass]) {

   echo "

      <table width=\"175\" border=\"1\" bordercolor=\"Black\" cellspacing=\"0\" cellpadding=\"3\">
       <tr><td bgcolor=\"#DDDDDD\"><font face=\"Arial\" Size=\"3\"><b>Logged In</b>:</td></tr>
       <tr><td>

              <font face=\"Arial\" Size=\"3\">

              $_SESSION[email_address]
              
              <p>

              <A HREF=\"../control_panel.php\">My Account</a>
              
              |

              <A HREF=\"../control_panel.php?logoff=1&redirect=\">Log Out</a>
              

       </td></tr>
      </table>

   ";
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// User Not Logged In --> Display Login Box
////////////////////////////////////////////////////////////////////////////////////////////////////

else {

   echo "

      <form action=\"../control_panel.php\" method=\"post\">
      <table width=\"175\" border=\"1\" bordercolor=\"Black\" cellspacing=\"0\" cellpadding=\"3\">
       <tr><td bgcolor=\"#DDDDDD\"><font face=\"Arial\" Size=\"3\"><b>Log In</b>:</td></tr>
       <tr><td>

              <font face=\"Arial\" Size=\"3\">

              e-Mail:<br><input name=\"email_address\" size=20 value=\"$_COOKIE[email_address]\"><br>
              Password:<br> <input type=\"password\" name=\"pass\" size=20><p>
              <input type=\"submit\" name=\"login\" value=\"Login\">


              &nbsp; <A HREF=\"../register.php\">Register</a> <p>
              <input type=\"hidden\" name=\"redirect\" value=\"$_SERVER[PHP_SELF]\">


       </td></tr>
      </table>
      </form>

   ";

}

?>


I want it to go to http://www.rea-reaa.org/secure/secure/index.php ..

Thanks =)

i2-Services, Inc. Wrote:
You have within the form to /form code:

<input type="hidden" name="redirect" value="/secure/interface/login_box.php">

Make that the correct path to where you wish to go.

Try changing:

<input type=\"hidden\" name=\"redirect\" value=\"$_SERVER[PHP_SELF]\">

to:

<input type=\"hidden\" name=\"redirect\" value=\"/secure/\">
it still takes me to
http://www.rea-reaa.org/secure/control_p.../index.php

....


i2-Services, Inc. Wrote:
Try changing:

<input type=\"hidden\" name=\"redirect\" value=\"$_SERVER[PHP_SELF]\">

to:

<input type=\"hidden\" name=\"redirect\" value=\"/secure/\">

I'm not sure if this has anything to do with it but try changing:

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

to

<form action=\"/secure/control_panel.php\" method=\"post\">
Pages: 1 2
Reference URL's