Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
Thread Tools
  #1  
Old 07-16-2009, 05:26 PM
Corporal
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 07-16-2009, 08:31 PM
Major
 
Join Date: Feb 2009
Location: Gran Canaria
Posts: 436
Send a message via ICQ to travlinman Send a message via AIM to travlinman Send a message via Yahoo to travlinman
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)
__________________

Travlinman

AguycanBeach.com
Aguycanbeachhostel
Comunidad Aguycan Beach

A great must do for all beginners by Lincslady
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 07-18-2009, 01:48 AM
Major
 
Join Date: Feb 2009
Location: Gran Canaria
Posts: 436
Send a message via ICQ to travlinman Send a message via AIM to travlinman Send a message via Yahoo to travlinman
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.
__________________

Travlinman

AguycanBeach.com
Aguycanbeachhostel
Comunidad Aguycan Beach

A great must do for all beginners by Lincslady
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 07-18-2009, 11:09 PM
Corporal
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 07-18-2009, 11:30 PM
Adrian29630's Avatar
Second Lieutenant
 
Join Date: Apr 2009
Location: Santo Domingo Dominican Republic
Posts: 110
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!
__________________
Regards

Adrian
www.repdomproperties.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old 07-21-2009, 02:30 AM
Corporal
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 11:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203