Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Topics

Recent Status Updates

View All Updates

Photo
- - - - -

Simple Login/Register/Main Script

align login registering

  • Please log in to reply
40 replies to this topic

#13 Whitey

Whitey

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 259 posts

Posted 14 July 2008 - 09:09 PM

Ahh np dude
  • 0

#14 vedran

vedran

    CC Newcomer

  • Just Joined
  • PipPip
  • 18 posts

Posted 25 August 2008 - 11:43 PM

I'm having problems with registration, I've changed mysql data to point to my db server, login works, as well as logout. Only problem is registration, once I register new accouint, I'm informed it was successfully created, even though nothing really happened... What could be the problem?
  • 0

#15 Guest_Jaan_*

Guest_Jaan_*
  • Guest

Posted 26 August 2008 - 11:20 AM

inserting info into database..post your script
  • 0

#16 Whitey

Whitey

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 259 posts

Posted 27 August 2008 - 12:30 PM

Well i made this awhile ago so i see some flaws of stuff i didn't add. Like or die(mysql_error()); but have you altered anything?
Also show me your config.php code
  • 0

#17 vedran

vedran

    CC Newcomer

  • Just Joined
  • PipPip
  • 18 posts

Posted 30 August 2008 - 05:29 AM

Sory, my bad, I've changed a bit the code, and the problem was made by me.
Anyway, it works perfectly now, and really thanks for the script
  • 0

#18 vedran

vedran

    CC Newcomer

  • Just Joined
  • PipPip
  • 18 posts

Posted 31 August 2008 - 10:04 PM

Ok, I have few questions, hopefuly, they'll be no big deal.
First of all, I have added one more field in DB. gid (group id).

1) When user registers account should I just add something like this to the process.php
$query = $config->query("INSERT INTO members (id, username, password, email, gid) VALUES (NULL, '$myusername', '$encrypt_password', '$email', 'Registered User')");


2) How can I using the session_is_registered, show specific content for only gid of my own choice, for example, I want to show admin.php only to 'Admnistrator' and 'Super Administrator' groups
  • 0

#19 akrobat

akrobat

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 01 September 2008 - 08:13 AM

I've put the script together, however. When trying to use register.php, it returns me with:

Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/xxxx/public_html/SCRIPT/config.php:24) in /home/xxxx/public_html/SCRIPT/process.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/SCRIPT/config.php:24) in /home/xxxx/public_html/SCRIPT/process.php on line 128

When using login.php it returns me with:

Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/gitfan5/public_html/SCRIPT/config.php:24) in /home/xxxxx/public_html/SCRIPT/process.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/SCRIPT/config.php:24) in /home/gitfan5/public_html/SCRIPT/process.php on line 48

Can anyone help?
  • 0

#20 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 01 September 2008 - 08:20 AM

Not sure why you quoted my post, but yeah, it's a nice script. And welcome to CodeCall, I sure hope you'll stick around.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#21 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 01 September 2008 - 11:16 AM

I've put the script together, however. When trying to use register.php, it returns me with:

Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/xxxx/public_html/SCRIPT/config.php:24) in /home/xxxx/public_html/SCRIPT/process.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/SCRIPT/config.php:24) in /home/xxxx/public_html/SCRIPT/process.php on line 128

When using login.php it returns me with:

Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at /home/gitfan5/public_html/SCRIPT/config.php:24) in /home/xxxxx/public_html/SCRIPT/process.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/SCRIPT/config.php:24) in /home/gitfan5/public_html/SCRIPT/process.php on line 48

Can anyone help?


Have you modified the script in any way?
  • 0

#22 Whitey

Whitey

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 259 posts

Posted 04 September 2008 - 05:14 PM

Ok, I have few questions, hopefuly, they'll be no big deal.
First of all, I have added one more field in DB. gid (group id).

1) When user registers account should I just add something like this to the process.php

$query = $config->query("INSERT INTO members (id, username, password, email, gid) VALUES (NULL, '$myusername', '$encrypt_password', '$email', 'Registered User')");


2) How can I using the session_is_registered, show specific content for only gid of my own choice, for example, I want to show admin.php only to 'Admnistrator' and 'Super Administrator' groups

The way i would write this is like..
In my config.php i would define the userlevel for the "admin" and "Super Admin" Like so
define("ADMIN", "3");
define("SUPER_ADMIN", "4");

Then in the sql i would add a column for userlevel.. default being 1 (user)

then do a sql search on that username and get the userlevel.

then on the new page add this

<?
if($userlevel == SUPER_ADMIN){
view the super admin functions here
}
elseif($userlevel == ADMIN){
view the admin functions here
}
else{
you could either put a echo saying your not allowed to view this page you dont have the privledge's or you can put the "users" functions here.
}
?>

}
  • 1

#23 vedran

vedran

    CC Newcomer

  • Just Joined
  • PipPip
  • 18 posts

Posted 05 September 2008 - 05:17 AM

Thanx, that helped a lot.
and +rep for being really helpful :D
  • 0

#24 Whitey

Whitey

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 259 posts

Posted 05 September 2008 - 06:49 AM

Thanks haha and no problem.. I know how hard it is to start off so helping is a gratitude
  • 0





Also tagged with one or more of these keywords: align, login, registering

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download