Jump to content

PHP CODING HELP - CLIENT LOGIN SYSTEM


michael1291

Recommended Posts

I am currently working on a client login system, up to now it allows users to register and then it looks up the database and redirects them to their own are upon successful login. after they arrive there it displays their personal details and allows them to change them, now  how can i redirect users based on their username for example if a normal user logs in it takes them to their area and if an admin logs in  it takes them to their area. also i am wondering if it is possible to create an on/ off button by this i mean if the buttons state is on then enter value in database if its off enter a different value in database.

 

i would like to thank you in advance and appreciate any help, michael. :)

Link to comment
https://forums.phpfreaks.com/topic/239365-php-coding-help-client-login-system/
Share on other sites

Confusing how you said it, can that be done.. yes.

It sounds like (from what you have posted) that you are doing a lot of things that you are not sure are possible.

I would recommend looking at PHP tutorials and MySQL tutorials in order to see what functions can be used where.

Its like creative yet logical problem solving.

Good luck, we are here to help you once you are on your way, hence the forum category PHP Coding Help.

sorry for being confusing did not read the post before submitting it. I have worked it out, i was already using $_SESSION['member_id'] so i just wrote if the member id = to that of the admin then redirect to the admin area else redirect to the client area.  Does any one know how to create a button that will send a value to the database for example if a user presses the button on it will send a value to the database and if they press it again it will then update with a different value. I' am guessing i may need to use javascript.

sorry for being confusing did not read the post before submitting it. I have worked it out, i was already using $_SESSION['member_id'] so i just wrote if the member id = to that of the admin then redirect to the admin area else redirect to the client area.  Does any one know how to create a button that will send a value to the database for example if a user presses the button on it will send a value to the database and if they press it again it will then update with a different value. I' am guessing i may need to use javascript.

 

You can easily do this with jQuery. Have a look at http://api.jquery.com/jQuery.post/

what i am trying to do

 

" if the user turns the button off they will stop receiving information into their private members area but when they turn the button back on again they will then start receiving the information when it is available."

 

by the way i appreciate the help and have found that you guys reply quickly compared to forums i have used in the past!!!

Something on the idea of this

 

function update()
{
$.post('update.php',function(data){
	$('#info').html(data);
});

var timeout = setTimeout('update', '1000');
}

$('#button-on').click(function(){
$('#button-on').val('Turn Off');
$('#button-on').attr('id','button-off');

update();
});

$('#button-off').click(functon(){
$('#button-off').val('Turn On');
$('#button-off').attr('id','button-on');

clearTimeout(timeout);
});

 

<div id="info"></div>
<input type="button" id="button-on" value="Turn On" />

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.