How to create LOGIN AREA (register,log in)


I am making my web sites with a Xara web designer 6. using server to upload the files to the internet.

Now i want to add LOGIN area to my site, where people can “register”, “login”, and “forget passport”. (so there would be restricted area (a page or two) (for example: index5, where you would have to register, - to see it) … and it would be ok that i create user names and passports manually for people (it doesnt have to be automacilly)

Can any body please help me (i am making my sites in Xara web…)
I am beginer, just a design platform website maker.

THANK YOU VERY MUCH :slight_smile: … have a nice day…

If you are using a wysiwyg program for creating your site then you will most likely be restricted to whatever functions they have for such a feature. Do they offer anything like that with the script you are using? If they don’t then you may want to look into a CMS or something that has a functionality close to what you are looking for. What do you want the users to be able to do once they have logged in?

You may consider to move to the next step by using mySQL integration with your website…
You may refer to php and mySQL tutorials. :slight_smile:
And I guess you can still make the website using Xara but you have to work around with the SOURCE page in the editor…

Please check this tutorial <-- Making a login page
and this one <-- Making a database using phpMyAdmin…
If you got trouble, please ask us again…
Hope helps :slight_smile:

hi willypt

i would like to create a login page and a registration page for my users,
do you know anything about creating scripts for phpmyadmin,
i have created a table in mysql with 7 rows,
Firstname, VARCHAR 65
Lastname, VARCHAR 65
E-mail, VARCHAR 65
Username, VARCHAR 65
Password, VARCHAR 65
Verify password, VARCHAR 65

i have looked at serveral tutorials and still don’t get them a 100%
could you help oknow anybody else who could please.

i found this script to be very useful ->

It´s easy to set up and integrate in your site

Hi Bad Karma

really appreciate the help, i downloaded the script and inserted the table into my mysql named users i had to modify the scripts abit ie,dbhost , dbuser, dbpassword, dbdatabase every seems to be fine appart from when i insert my dbhost it comes up with a error could you by any chance please thanks in advance.

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 1
STR: <?
SQL: <?php

define (“DB_HOST”, “”);<?php

define (“DB_HOST”, “”);<?php

define (“DB_HOST”, “”);<?php

define (“DB_HOST”, “”);<?php

define (“DB_HOST”, “”);<?php

define (“DB_HOST”, “”);<?php

SQL query:

<?php define (“DB_HOST”, “”);

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php

define (“DB_HOST”, “”)’ at line 1

where did you get all the


from? i am sure they aren´t there in the original config file.

i donwloaded the script from this website and it was in the dbc file

I know it´s in the dbc.php file, but look at the original code for the database configuration

define ("DB_HOST", "xxxxxx"); // set database host
define ("DB_USER", "xxxxxx"); // set database user
define ("DB_PASS","xxxxxxx"); // set database password
define ("DB_NAME","xxxxxx"); // set database name

and then look at the output of your error message

define ("DB_HOST", "");<?php

define ("DB_HOST", "");<?php

define ("DB_HOST", "");<?php

define ("DB_HOST", "");<?php

define ("DB_HOST", "");<?php

define ("DB_HOST", "");<?php

I wonder where that <?php at the end of each line comes from?
Can you post the first 30 lines of your dbc.php file please? Prior to posting please remove your details or replace them with some fictional details


define (“DB_HOST”, “"); // set database host
define (“DB_USER”, "
"); // set database user
define (“DB_PASS”,"
"); // set database password
define (“DB_NAME”,"
*****”); // set database name

$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(“Couldn’t make connection.”);
$db = mysql_select_db(DB_NAME, $link) or die(“Couldn’t select database”);

/* Registration Type (Automatic or Manual)
1 -> Automatic Registration (Users will receive activation code and they will be automatically approved after clicking activation link)
0 -> Manual Approval (Users will not receive activation code and you will need to approve every user manually)
$user_registration = 1; // set 0 or 1

define(“COOKIE_TIME_OUT”, 10); //specify cookie timeout in days (default is 10 days)
define(‘SALT_LENGTH’, 9); // salt for password

//define (“ADMIN_NAME”, “admin”); // sp

/* Specify user levels */
define (“ADMIN_LEVEL”, 5);
define (“USER_LEVEL”, 1);
define (“GUEST_LEVEL”, 0);

/*************** reCAPTCHA KEYS****************/
$publickey = “***********************”;
$privatekey = “**********************”;

/**** PAGE PROTECT CODE ********************************/

function page_protect() {

global $db;

/* Secure against Session Hijacking by checking user agent */
if (isset($_SESSION[‘HTTP_USER_AGENT’]))

// before we allow sessions, we need to check authentication key - ckey and ctime stored in database

/* If session not set, check for cookies set by Remember me /
if (!isset($_SESSION[‘user_id’]) && !isset($_SESSION[‘user_name’]) )
if(isset($_COOKIE[‘user_id’]) && isset($_COOKIE[‘user_key’])){
we double check cookie expiry time against stored in database */

$cookie_user_id  = filter($_COOKIE['user_id']);
$rs_ctime = mysql_query("select `ckey`,`ctime` from `users` where `id` ='$cookie_user_id'") or die(mysql_error());
list($ckey,$ctime) = mysql_fetch_row($rs_ctime);
// coookie expiry
if( (time() - $ctime) &gt; 60*60*24*COOKIE_TIME_OUT) {


/* Security check with untrusted cookies - dont trust value stored in cookie.
/* We also do authentication check of the ckey stored in cookie matches that stored in database during login*/

 if( !empty($ckey) && is_numeric($_COOKIE['user_id']) && isUserID($_COOKIE['user_name']) && $_COOKIE['user_key'] == sha1($ckey)  ) {
 	  session_regenerate_id(); //against session fixation attacks.

	  $_SESSION['user_id'] = $_COOKIE['user_id'];
	  $_SESSION['user_name'] = $_COOKIE['user_name'];
	/* query user level from database instead of storing in cookies */	
	  list($user_level) = mysql_fetch_row(mysql_query("select user_level from users where id='$_SESSION[user_id]'"));

	  $_SESSION['user_level'] = $user_level;
   } else {

} else {
header(“Location: login.php”);

Weird, looks alright. Let me do a quick test on my 000webhost test account

Script works fine ->
Just did a quick setup without any Captcha to see if the script works. So can you doublecheck your database details you put in the configuration file?

it show the error in image verification on line no. 465 and 466…
plzzz help me…
this script is the same

you put the wrong server, instead of putting the host name of the web server use the name of the mysql server (typically mysql**, ** being a number)


[COLOR=“Red”]Image Verification [/COLOR]
[COLOR=“Blue”]PHP Error Message [/COLOR]

Warning: require_once(recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in /home/a4435963/public_html/register.php on line 465

[COLOR=“seagreen”]Free Web Hosting [/COLOR]

[COLOR=“blue”]PHP Error Message [/COLOR]

Fatal error: require_once() [function.require]: Failed opening required ‘recaptchalib.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/a4435963/public_html/register.php on line 465

[COLOR=“SeaGreen”]Free Web Hosting [/COLOR]


Please consult the FAQ for the script. This error is caused by you not having uploaded the recaptchalib.php file to the directory you installed the login script in. also you need to get the private/public keys to make the recaptcha verficiation work

can u fix this problem then plzz tell me…
i really need this script 4 my website…

Please download this zip file
Then extract it and put recaptchalib.php in the directory you install login script
and here is a page you have to consult further with.

Hope helps,

It´s all in the FAQ, especially the part about recaptcha. And you need to sign up with Recaptcha to get the keys for the image verification to work :slight_smile:

I have done all things but it is not registering …
it shows * ERROR - Invalid email address.