Results 1 to 6 of 6

Thread: Php Login Script
      
   

  1. #1
    Join Date
    Jul 2009
    Posts
    11

    Default Php Login Script

    I am on my second day of using BV and I have a 2 questions. 1. Is it possible to have a login script on the index page? My login script file is main_login.php. ( From what I have read the answer is no because of naming the page index.php or index.html)
    2. Where would i put the following scripts in terms of putting it on the web page. (which pages?)

    Create file login_success.php
    // Check if session is not registered , redirect back to main page.
    // Put this code in first line of web page.
    <?
    session_start();
    if(!session_is_registered(myusername)){
    header("location:main_login.php");
    }
    ?>

    <html>
    <body>
    Login Successful
    </body>
    </html>

    and
    Logout.phpIf you want to logout, create this file

    // Put this code in first line of web page.
    <?
    session_start();
    session_destroy();
    ?>


    Again which web page? Any help would be greatly appreciated.

    www.heatmeeting.com

  2. #2
    Join Date
    Feb 2009
    Location
    Gran Canaria
    Posts
    443

    Default Re: Php Login Script

    2 answers...
    yes you can, just put it on the index page if you want to use a script or....

    use the built in log-in in BV11 (no need for a script)

  3. #3
    Join Date
    Feb 2009
    Location
    Gran Canaria
    Posts
    443

    Default Re: Php Login Script

    to clarify my previous post...

    the script should have come with instructions so it should have told you where to put it.
    As I previously said and as u asked, placing it on the index page....right click on a blank part of your page and select "page HTML" now in the "start of page" or "inside head tag" depending on the instructions is where you will need to place it.

    or you can use option 2 the BV built in log-in as I am using (we just have to await the tutorial or post in the forum when we can not go any further alone.
    Good Luck.

  4. #4
    Join Date
    Jul 2009
    Posts
    11

    Default Re: Php Login Script

    Well I have been trying to configure the login script but I am still having trouble. I did get the registration form to work with email validation. I also set up my sql tables yet it seems that I am still having an issue with the login script. I will still keep working and hopefully have it figured out by the weekend. Thanks for your reply. www.heatmeeting.com

  5. #5
    Join Date
    Apr 2009
    Location
    Santo Domingo Dominican Republic
    Posts
    118

    Default Re: Php Login Script

    As an aside it would not be normal to have a login requirement on a websites index page as this is the first page a visitor arrives on. If you have to login here you have no idea what you are logging into. Normally the index page is what tells a visitor what the site is all about and what benefits they will receive by logging in to protected pages. Maybe you will only be allowing people to access your site at all by logging in having given them a reason for doing so elsewhere or because it is a members only site of some description, but just a thought! Also the first line of the script you posted refers to "redirect back to main page" If your login requirement is on your index page there will not be a page for them to go back to!

  6. #6
    Join Date
    Jul 2009
    Posts
    11

    Default Re: Php Login Script

    Hey Adrian
    I agree about having a login script on the index page. I have changed that. Also i have fixed the redirect issue. I am now trying to encrypt passwords when the user registers. When I check my data table in Mysql the result is a 0 (under the password field) so for some reason I cant get it to encrypt. I will keep trying. www.heatmeeting.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •