HOME       >>       Programming

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


sylvanasp

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


8ennett

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?

sylvanasp

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


yordan

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.


8ennett

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.


sylvanasp

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


8ennett

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.


sylvanasp

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


8ennett

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.


sylvanasp

i love u manu saved mei dont need it in 3-4 daysso take ur time,dont waste 10h in one day for mety ty ty ty ty ty tyi owe u BIG TIME


8ennett

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.


8ennett

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.


sylvanasp

OMGtytytytytytytytytytytytytytytytytytytytyur my heroooooooowoooooooowwww tanx for those great comments tooman i owe u alot


sylvanasp

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

sylvanasp

ops ops opssry for triple postinsry bennet i changed setup.php in my document not in www folder it works like a charm thnx again


8ennett

Brilliant, that's good news. Remember though, if you upload this script to a linux server then you will need to change the file permissions of the images/users directory to 0777 otherwise you will not be able to upload images, but like I said that's only on a linux server. Best of luck with your exam, let me know how you did.


sylvanasp

ty man ill never forget thisthanx to u i got an Awish u luck*cheeers



VIEW ORIGINAL REGISTER GET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.