Jump to content
xisto Community
sylvanasp

Can Someone Help Me Modify This Login Script? [solved]

Recommended Posts

i had this login script,i lowerized its functions a little bitbut cant do more it too complicated for a newb like mecan some one help me delete the activation throu email codes in these files,and those extra fields on registration form and their DB's fields for me plz?all i want from this script is that i want to login wit 3 different user access

Share this post


Link to post
Share on other sites

i had this login script,i lowerized its functions a little bit but cant do more it too complicated for a newb like me

can some one help me delete the activation throu email codes in these files,and those extra fields on registration form and their DB's fields for me plz?
all i want from this script is that i want to login wit 3 different user access



Sorry I don't quite understand what you mean. Are you wanting to remove the database connection and comparison all together and have a login script for only 3 different users? If so do you want the 3 users usernames and passwords hard coded in to the php file?

Share this post


Link to post
Share on other sites

look at it this way:my DB tabels are firstname/lastname/username/password/ACCESSand this access tabel can get 3 diffrent int numbers 3for admins/2 for users/ 1for guestto 3 diffrent main pages and a registration form to add given data to DB firstname/lastname/username/password/i really need this for my projectbut cant find a rdy code about it on the net

Edited by sylvanasp (see edit history)

Share this post


Link to post
Share on other sites

I think that you did not fully understand your project.The field ACCESS can have only three values.But the field username can have a lot of values, an unlimited number of values.This means that you really need to handle a database, in order to associate each one of a lot of usernames, to his ACCESS value.

Share this post


Link to post
Share on other sites

right well if want you dump your current database in to a query and post it here along with information on what exactly you want the login script to do (login, register, etc) then I can throw together a quick script for you, it would simply be a matter of adding your own html to it. However I would advise against doing this. If you are going to try and build a website using snippets and examples of code from all over the web you will end up with one hell of a mess. Your code will be formatted differently, there will be loads you don't understand, stuff running that shouldn't be running causing unnecessary server load, and not to mention all the security holes there is going to be. I recommend building your own or settling for something prebuilt which is similar to what you want. Any attempt at what was mentioned above will most likely end in disaster.

Share this post


Link to post
Share on other sites

security isnt a problemand im not going to upload it to a web hosti just wana get it together and use WAMP to show it to my teacherhe just wana see if it works or not,then ill pass my examits not a FINAL university projectthose files i uploaded wer toooo pro for my project,and i couldnt find a simple one on then net thats why im here asking someone to help

Share this post


Link to post
Share on other sites

right lol so a little bit of cheating going on is there. Yeah no worries, I'll throw something together for you in the morning and post the code in this thread. Does it need to have any specific details or code structure, even in the database or can i just construct my own for you? I probably won't use the ACCESS column you see, maybe use an INT(2) column allowing for a more varied user structure.

Share this post


Link to post
Share on other sites

THANX A BUNCH MAN,thank ufor the recordit doesnt matter anything,not even use md5 for coding passwordsjust a REALLY simple login page wit 3 account in data base,1user/1admin/1guestand wen each one of these 3 logedin they go to their main pageand a registration form to put first name,last name,username,pass to the DB as usersthen i think i can do the restand if u could make a page that have pictures NAME, that i have in C://wamp/www/images/ in itand a up load button too would be GREAAAAT FAVOR to meill owe u my passed exam after thisits not a problem if u dont make the upload thingur doing a HUGE favor tome for doing that access login page thing

Share this post


Link to post
Share on other sites

No problems lol but you're gonna owe me for this one. I'm going to bed now but after I've taken my little boy to school in the morning I'll get on it. Should be ready in about 10 hours.

Share this post


Link to post
Share on other sites

No, it's not going to take me 10 hours to write it lol 8 hours to sleep, an hour to wake up and drop my boy at school, half an hour to sit around, have a smoke and scratch my balls which I have just finished doing so it'll take me half an hour at the most. Also the favour I want from you for doing this is simple enough, I want you to learn the code. I'll comment all the php for you so you can understand what each bit is doing, that way you are forced to go through all the code anyway removing the comments before you hand it in.

Share this post


Link to post
Share on other sites

Ok I've finished the login page for you, you can download it from http://forums.xisto.com/no_longer_exists/.

Now like I said I've fully commented all the lines of php code in there so you will have to remove them before submitting the site. The features I've made for you are:

Login Page: Depending on what type the user is they are taken to different home pages
1 = Admin, 2 = User, 3 = Guest

Registration Page: All users who register are users by default (2)

I've also made it so users can't access admin and guest home pages, and so on for guests. And the other part you wanted is in there as well which is the image uploader.

It uploads an image to images/users/userid.jpg so if your user id is 5 then when you upload an image it will be images/users/5.jpg but if the user hasn't uploaded an image or deleted their image (there's a delete button as well) then it will display an image with a human silhouette to indicate they have no image.

So I hope that's everything you wanted in the script, when you want to set it up just edit the setup.php file and change the variable values to your database information (host, username, passsword and database name) and it will work fine. Also I've included a text file called tables.txt which has the queries in it to create the 'users' table and insert three users in to it. Each user has a different security level (1, 2 and 3) and the password to login to these accounts is just 'password'. Any problems just give me a shout and I'll help you out.

Share this post


Link to post
Share on other sites

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\setup.php on line 10

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\setup.php on line 11

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\wamp\www\setup.php on line 11

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\login.php on line 33

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\wamp\www\login.php on line 33

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\login.php on line 36

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\login.php on line 36

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\login.php on line 38

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\setup.php on line 16

---------------------------
my setup php is like this

<?php// Open database connectionfunction opendb(){	global $mysqlconnection;	// Input your database details here	$confighost = 'localhost';	$configuser = 'root';	$configpass = '123';	$configdb = 'test';	$mysqlconnection = mysql_connect($confighost, $configuser, $configpass);	mysql_select_db($configdb);}// Close database connectionfunction closedb($connection){	mysql_close($connection);}?>
i used user name: admin
and password : password to login
Edited by moderator (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.