![]() |
|
| |||||||
| Notices |
| BlueVoda Tips, Tricks and Shortcuts Know a great BlueVoda (or Web design) tip or trick? Share it with the world here. Become famous for your brilliance! Please, No Questions or Problems! |
![]() |
| | Thread Tools |
|
#1
| |||
| |||
| Have you ever wanted to make a login script so you can have membercontent? This tutorial will show you how using php. No database will be used. 1) Creating a form Here is the code for making the form. The form asks for your username and password. Save this code as login.php Code: <html>
<head>
<title>Please login</title>
</head>
<body>
<?php
if(isset($_GET["wrong"])){
echo("<b>Username or password is incorrect!<br />Please try again.</b>");
}
?>
<form action="login2.php" method="post">
<br />
Username:<br />
<input type="text" name="username" /><br />
Password:<br />
<input type="password" name="password" />
<br />
<br />
<input type="submit" value="Login" />
</form>
</body>
</html> between the <form></form> tags we have 3 input fields. 1 for the username, 1 for the password, and 1 that will submit the inputs and send it to login2.php. Note that the form will be sent using the "post" method. This is the safest. 2)Checking the userinput In this step we will check if the username and password are correct. This is done with php. No html will be used. Create a new page and call it login2.php. Give it the following content: PHP Code: 1)$usernames is an array with all the usernames. To add a new one: PHP Code: PHP Code: user1 will be able to login with the password pass1, not with any other password. user2 with pass2 and no other. 3)$page is the page the user will go to when he is logged in. Change mypage.php to the page you would like to be the main page for logged in users. make sure the quotationmarks are still around it! 3) Checking if the user is still logged in Create a new page, call it login3.php with the following code: PHP Code: If it doesn't it sends you to the login page. 4) Making your pages protected All the pages that you want to be protected need to have a .php extension! otherwise they cannot be protected. Add this piece of code to the first line. PHP Code: Now you pages are protected! simple? 5) Extras making a log out page: make a new .php page and add the following contents at the very beginning: PHP Code: An other extra: showing the user's name: just put this piece of code in any secured page where you want to show the name: PHP Code: |
|
#2
| ||||
| ||||
|
Just keep in mind not to intergate this with your website using BV, because its impossible with BV to put php in before the head is declared. This is going to give you an error when using session_start(); session_start(); has to be declared on the first line of a page (or second if you count <?php) before any other header is declared
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |
|
#4
| |||
| |||
| Quote:
will you please tell me how can l use the above script if I am using blue voda. How to save the pages as .php extension |
|
#5
| ||||
| ||||
| Quote:
View->Page HTML->Start of Page
__________________ Forum Moderator BlueVoda Specialist |
|
#6
| ||||
| ||||
|
Only one observation: the usernames and passwords in this script are hardcoded in the script itself. This means that the script - login2.php - needs to be edited manually everytime a new user must be added. This is not so convenient, if you expect to have many visitors. There will also be a "dead" time before the site administrator updated the script. A solution would be offcourse to use a database, or, have the registration form info (username and password) writen in an file, wich could be in this way automatically updated. However, very useful!. Well done mate!
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#7
| |||
| |||
| I have got the downlodable pages from form maker now where to upload these pages and how to upload. should it be upload thru publishing blue voda or blue ftp or cpanel file manager. |
|
#8
| ||||
| ||||
|
Read the installation instructions here
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#9
| |||
| |||
|
Thanks nbop and other member for the tutorial creating vbmenu_register("postmenu_48386", true); login for multiple user, however, have created this on my site but don´t know what to do next, what area of my cpanel will i load this into as i am using cpanel and how do i create an account for the user so that as soon as he signin he will see his information, secondly do i need to create database for the login form and who. i will hope to hear from you soon about this
|
|
#10
| ||||
| ||||
|
I'm afraid that the above script is not so automated. After a user has registered, you have to MANUALLY insert his username and password in the script as described above. Then you must upload again the updated script to your server and then let the new member know that he / she can go on visiting your site. Till you do this, he / she won't be able to loggin. You don't need to create a database, not with this script.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#11
| |||
| |||
|
Thanks for the reply what i am saying about is this, i have a site which have a registration page and login page, when a user register his information to the site throught eh login page what do i do next and how do i direct his register information to a page he will see when he login, i have don the pages discribe before but i want to know how i can setup a database for it as i am using cpanel
|
|
#12
| ||||
| ||||
|
The above script doesn't make use of a database. Also, it doesn't describe how to make a registration form. You need to 1. Create aregistration form where the user fills in his desired username and password along with other information. Set the form so that the info is sent to you through an email. Update the script with the new username and password, and re-upload it on the server. Let the user know that his registration has been approved and he may now loggin in your site.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#13
| |||
| |||
|
This script can be inserted into a Blue Voda page simply by using the html tool at the top of the left toolbar to insert an html box. Double-click the box to open it and paste in the code. The php code will be embedded in the page. However, there seems to be a problem with the script. This appears above the form fields for the Name and Password before and information is entered: Username or password is incorrect! Please try again.</B>"); } ?>
__________________ No matter how fast you are going, there is always someone trying to pass. |
|
#14
| |||
| |||
|
also tried this by uploading the php file to my server. When I ran it I got the following error: Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/colescom/public_html/FormTools/phptest.php on line 8 Areany values supposed to load values supposed to be modified before running the script?
__________________ No matter how fast you are going, there is always someone trying to pass. |
|
#15
| |||
| |||
|
Thanks i got ur explainatioon about the application form, plz can you give me step by step what files to create and what directory are needed to work all this and how do. where do i do when the information on the application form has been sent my email . what thing he see when i register user login
|
|
#16
| |||
| |||
|
Hi...I tried to create a login using the script that was posted...I uploaded it to try it and I am receiving an error message. The error message is saying the following: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/41/d171920401/htdocs/Beta_Site/login2.php on line 9 Does anyone have any suggestions what I m doing wrong? Thanks, John |
|
#18
| |||
| |||
| Quote:
thats the error message i get |
|
#19
| ||||
| ||||
|
The session cache limiter command has to be before the session_start command. Change your script. However, it can also fail for other reasons too. Please post here the first 14 lines of your script.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#20
| ||||
| ||||
| Quote:
Quote:
|
|
#21
| ||||
| ||||
|
I found these in this part of the script. There might be other errors. Please also use single quotes, as i corrected it.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#22
| |||
| |||
|
i fixed everything but still get the same error message!
|
|
#23
| ||||
| ||||
|
Did you place this script inside a BV page ?
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#24
| |||
| |||
|
no. I got to cpanel and then filemanager. I write scripts/edit/fix in notepad and then upload to public_html
|
|
#25
| ||||
| ||||
|
Well, to debug i would need to install the whole script and see what it does. However, i see that you have a clan site. I beleive that such a script, where you should always update it manually, is not a good solution for you (i beleive that you expect to have many members, so you would need a script that allows users to register themselves, then the username and password are stored in a database, and the script would retreive the info from the database
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#26
| |||
| |||
|
no, the script is for a friend of mine. and I dont mind managing his users. Also, he doesnt want auto registration. If you could debug the script for me that be sooo awsome!
|
|
#27
| |||
| |||
|
also, navaldesign. consider writing a topic on a mysql login database script?
|
|
#28
| ||||
| ||||
|
I do have a full MySQL login script that i created for my clients. However, it requires a registration form and some additional knowledge for installing it, since it is part of a major script system, it is not a stand alone. Creating such scripts, and then creating a tutorial, is very time consuming, and since my work only allows for limited free time, i will do it when i'll be able to.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#29
| |||
| |||
|
thank you very much navaldesign
|
|
#30
| |||
| |||
|
so. should I just leave this script alone for now or......
|
|
#31
| |||
| |||
|
just curoius.... naval, hows the debugging coming with the script?
|
|
#32
| ||||
| ||||
|
Clanffa, i'm sorry but i have not made myself clear. I wrote that in order to debug , i would need to install the script and see what it does. I'm sorry, i do not have all this time. As for my script, it also requires lot of time to create a tutorial based on it. Your solution: a net search for "Free loggin script". You will find many, choose whichever you like.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
|
#33
| |||
| |||
|
oh ok. no problem navaldesign.
|
|
#34
| |||
| |||
|
can someone plx try to fix the script. im super NOOB at php.
|
|
#36
| |||
| |||
|
Right i have installed all of this code i have put the login pages 1-3 in my main directory and then creted a sub folder called members and creted a file called members.php. but no matter what i do i log in and i keeps on stoping at the login2.php page. login1 login2 login3 members-members.php Also even if i put in the wrong data you can still get redirected to login2.php. you can see this at : http://fozze.8888mb.com/login.php. Please help me!!! |
|
#38
| ||||
| ||||
|
I have a free membership script that will do all of the above which uses a database: If you want to try it out, go to this thread http://www.vodahost.com/vodatalk/cus...-new-site.html or click on the first entry under my signature. For those who wish this to be installed for them, I can provide that service for a small fee. |
|
#39
| |||
| |||
|
I'm new w/ BV so could use some detail help!!! I just want 1 user name/password for a site that I want only my team to have access to. (Each user doesn't need their own user name/password.) So, step-by-step, what do I do? From Pablo: Yes, you can insert this code directly into BV: View->Page HTML->Start of Page Which code? Also, for the other pages that the main page links to, do they need codes? Thanks for helping a newbie!!! |
|
#40
| ||||
| ||||
|
It is not only a simple oiece of code that you need. You also need, (if only one username / password are required) at least a login page with related code. However, for your purposes, a protected folder will do the job the same way and much more easier for you. Please watch this tutorial: http://www.vodahost.com/demowolf/x3/...3-protect.html Create a protected folder, and publish ALL the pages that you only want your members to be able to reach, inside that folder. This way you don't need any login page or other, the necessary login popup is automatically displayed.
__________________ Navaldesign Logger Lite: Low Cost, Customizable, multifeatured Login script Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more.... Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |