Development Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsCommunityDevelopment Tutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 27th, 2003, 10:27 PM
foomal foomal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 foomal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
After we issue the following query:

$sql = mysql_query("UPDATE users SET activated='1' WHERE userid='$userid' AND password='$code'");

to check whether the 'activated' filed really get updated we can use:

$checkupdate = mysql_affected_rows($sql);
if($checkupdate >= 0) {
// record updated
} else {
// record not updated
}

instead of issue a 'select' query.
NOTE: we check if $checkupdate is GREATER or EQUALS to zero


Foong.

Reply With Quote
  #2  
Old March 28th, 2003, 12:25 AM
lemkepf lemkepf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 lemkepf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
also, did you know that the second page is copied 2 times? Great article, very simple and easy to follow! THanks!
Paul

Reply With Quote
  #3  
Old March 28th, 2003, 12:45 PM
jmc jmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 8 jmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Problem with e-mail for user and password details

I am having a problem with the e-mail part of the membership system. I see that the article mentions that register_globals is turned off.

Would this stop e-mail being sent from my web host or is there some other problem that I'm unaware of.

Any help you could give would be much appreciated.

Regards

jmc

Reply With Quote
  #4  
Old March 28th, 2003, 01:04 PM
lemkepf lemkepf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 lemkepf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There could be a problem with the mail() command. I had some problems with a different piece of software before.

Instead of this:
PHP Code:
 mail($email_address$subject$message"From: MyDomain Webmaster<admin@mydomain.com>\nX-Mailer: PHP/" phpversion()); 


Change it to this:
PHP Code:
 mail($email_address$subject$message"From: My Domain<mye-mailaddress>"); 


Also, if you are on a home server, make sure port 25 is let through the firewall to allow senmail to use the smtp port.

Paul

Reply With Quote
  #5  
Old March 28th, 2003, 02:53 PM
jmc jmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 8 jmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the help Paul.

I haven't used the e-mail account on my site yet, but I presumed the e-mail would have worked right away.

I'll give your suggestion a try and set up some e-mail accounts at the same time.

Thanks again,

Jim

Reply With Quote
  #6  
Old March 29th, 2003, 11:18 AM
jmc jmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 8 jmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

Paul,
I changed the file as you recommended and set up a new e-mail account on my site but still no success

Regards,

Jim

Reply With Quote
  #7  
Old March 29th, 2003, 05:16 PM
lemkepf lemkepf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 lemkepf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Have you tried sending the e-mail to a different account? I do know that when i tried to send e-mail to my gmx.net e-mail account the e-mail never gets to me. Dont know why, i'm guessing they has some kind of filtering software.

Also you might want to check to see what version of PHP and MySql your server is running. Check with your sysadmin and ask him if their is something wrong with the mail() command on their server.

Does everything else work on the pages?
jmc might want to help you out some more. It might be something with the script. Did you pull down the zip file with all the pages? Use that instead of copying and pasteing from the site, that way you have everything correct.

Cna't think of anything else...
Paul

Reply With Quote
  #8  
Old March 30th, 2003, 02:00 AM
foomal foomal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 foomal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
email problem

I used to have the same problem where mail not sending out but the mail() function return true.

My solution is to set the corresponding values to sendmail_* properties in php.ini (I forgot the value that i used to set). All I can remember is to tell php where sendmail (I am using linux) is.

Not sure about Windows platform.


Foong

Reply With Quote
  #9  
Old March 30th, 2003, 12:33 PM
jmc jmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 8 jmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Paul,
I downloaded the zip file and changed the line that you mentioned earlier and nothing else. I have only used the files in the zip folder.

I presumed that if I uploaded the files to my site they would work as required, that is why I asked the question about the register_globals turned off; my site has them turned on and I don't know if I can change this or whether I need an administrator.

In answer to your question, I was sending the e-mail to an AOL account. I'll try sending it to the domain account and see if that works.

The account is on a Unix box, Foong, not Windows.

Thanks for your help.

jmc

Reply With Quote
  #10  
Old March 30th, 2003, 02:11 PM
lemkepf lemkepf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 lemkepf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I can't see why the Register_Globals would be the problem. But if you can turn them on it might work.... just try anything to fix the problem... Maybe JNC might be able to get in on this and see if he has come across anything that might not let the e-mail from being sent? Talk to your Sysadmin, he might be able to shed some light on it. What version of PHP are they running?
Paul

Reply With Quote
  #11  
Old March 31st, 2003, 11:38 AM
foomal foomal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 foomal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello jmc,

After digging up my php.ini file. this is the setting i have used.

sendmail_path=/usr/sbin/sendmail -t -f URL

In case you don't have access to php.ini file, put the following before you call mail():

ini_set(sendmail_path, "/usr/sbin/sendmail -t -f URL");


However, you should check with your sys admin to find out if you have sendmail installed.

Foong

Reply With Quote
  #12  
Old April 1st, 2003, 01:47 PM
jmc jmc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 8 jmc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for everyones help with this mail problem but I have to apologise for wasting your time.

I contacted my web host and after telling me to read an article on this site (http://www.devarticles.com/art/1/309/2) and trying out the script again, I have been told that the mail function has been disabled on the server to stop spam.

Thanks again for your help.

Lesson learned; Check with the site admin before trying to run scripts

jmc

Reply With Quote
  #13  
Old April 9th, 2003, 08:37 PM
axcelia axcelia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 axcelia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
parse error

I tried out your tutorial but when I tried to test it out by registoring from the join_form.html on my site I got

Parse error: parse error, expecting `','' or `';'' in /users/iwebland.com/pmta/register.php on line 43

any suggetions as to what might be wrong?

thanks Axcelia

Reply With Quote
  #14  
Old April 9th, 2003, 08:39 PM
lemkepf lemkepf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 lemkepf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what does line 43 look like?
Copy and paste that into here.
Paul

Reply With Quote
  #15  
Old April 9th, 2003, 09:06 PM
axcelia axcelia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 axcelia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
echo "<strong>Your email address has already been used by another member in our database. Please submit a different Email address! Please don't try to make multiple accounts, if u have lost the password go to <a href="lost_pw.html">The lost Password page</a>. If you are having problems email me at URL and I will try to fix the problem.<br />";

it's somewhere around that area.

thanks

Reply With Quote
  #16  
Old April 11th, 2003, 02:03 PM
foomal foomal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 foomal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hello,
try replace
<a href="lost_pw.html">
with
<a href='lost_pw.html'>

NOTE: Single quotes

Reply With Quote
  #17  
Old April 11th, 2003, 04:51 PM
<<RAN>> <<RAN>> is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Los Angeles, Ca
Posts: 11 <<RAN>> User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using this on your site.

If you use this on your site, the directories you are protecting from unregistered guests......do they all have to be under one main folder? Or can you protect different folders in different locations through out your site?

If you can protect different folders, how is this done?

Reply With Quote
  #18  
Old April 11th, 2003, 06:53 PM
axcelia axcelia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 axcelia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok thanks foomal actually a friend helped me out and told me to change it to <a href=\"lost_pw.html"\> then it worked. Thanks for your help

Reply With Quote
  #19  
Old April 11th, 2003, 07:26 PM
axcelia axcelia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 axcelia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok now I have another problem I have no errors but I keep getting

You did not submit the following required information!
Username is a required field. Please enter it below.

for everthing even though I entered stuff into the boxes

Reply With Quote
  #20  
Old June 1st, 2003, 02:50 PM
ajfn ajfn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 1 ajfn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
2 missing files?

After reading this great tutorial I was eager to try it out and fiddle a little with it, but then I was in for a sad surprise!

I downloaded the support files but login.php and verify.php was empty, thus leaving the script cribbeled.
- Or am I mistaken? Is it indeed soposed to be this way? (if so: why?)

If someone has the content of those 2 files I'd be delighted if you could post them here.

Thanks in advance!

Reply With Quote
  #21  
Old June 29th, 2003, 11:27 PM
defiantminds defiantminds is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 defiantminds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is there anyway to change the page checkuser.php redirects too? I changed the code to redirect to index2.php, but when I log in it still redirects to login_success.php

Reply With Quote
  #22  
Old June 30th, 2003, 03:42 PM
defiantminds defiantminds is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 defiantminds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Okay...I got it to redirect to index2.php, now on to my second question. I want it to show something like "logged in as 'username'" instead of their first and last name. I thought just replaceing "first_name" with "username" would work, but so far I haven't been able to do that. Also how hard would it be to code something to let the users edit their profile and password?

Reply With Quote
  #23  
Old July 1st, 2003, 12:40 AM
billybongchong billybongchong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: AU
Posts: 5 billybongchong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 53 sec
Reputation Power: 0
Question Sessions

Article Discussion: Creating a Membership System



Hi,

I am buliding a website that requires certain pages to required registration before entering. I chose your style of system "Membership System - Tutorial" Because in the future I will need different levels of users that will have access to different pages of the website.

MY QUESTION: ????

I am confused about the sessions. Is there anyway where by I can include a PHP file in the top of my Static HTML files (rename them to .php) to check to see if a user is logged in and if not redirect them to a page? Including if the user level system explained in the turorial?

I have gone through you tutorial numerous times and tied to impliment different things to my page and cannot seem to get the desired result..

Can you please help me please ...


I FOUND THE ANSWER>>> it was www.phpfreaks.com
---------------------------------------------------------------------

I forgot to add this little function.

If you wanted to check to see if a user is logged in on each page after following this tutorial, you could do this.

Write a function in a file that is included throughout your website. Inside this file, put:

function session_checker(){
if(!session_is_registered('first_name')){
include 'login_form.html';
exit();
}
}

and whenever you have a members only section, include the file and call this at the top of that page:

session_start();
session_checker();

It will validate the session, and if the appropriate session is not registered, it will exit your script leaving the login form in the user's browser.


-----------------------------------------------------------------------------
here is the link to the author.... great tutorial a complete membership system... with security! a real special treat!

[URL=http://www.phpfreaks.com/tutorial_comment/40/9/564.php#564]

Last edited by billybongchong : July 1st, 2003 at 01:09 AM.

Reply With Quote
  #24  
Old July 22nd, 2003, 01:48 AM
paragon paragon is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 paragon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can we download the files complete some were?

Reply With Quote
  #25  
Old August 5th, 2003, 12:19 AM
DDDooGGG DDDooGGG is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97 DDDooGGG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 33 sec
Reputation Power: 17
I likee this article very uch, but i have a question about the sessions. OPnce a user has loged into the membership area a session is created, when the user clicks "Logout", they are directed to a page where the can click "Yes or No" to definately logout. Anyway after clicking yes to logout and distroy teh session i can still go history back into the member area, and it seems the session hasnt been destroyed as i can refresh the member page and i am not redirected to a "Please re-login" page.
__________________
regards,


Fulton

Reply With Quote
  #26  
Old September 1st, 2003, 08:29 AM
Martin Krumme Martin Krumme is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 6 Martin Krumme User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
join_form.html

Everything works as described in the article. Great!
One question: Shouldn't join_form.html be renamed into join_form.php? Otherwise the user sees the initial values "echo ... .". The link in register.php should equally be renamed?

Reply With Quote
  #27  
Old October 3rd, 2003, 09:55 PM
mats bergman mats bergman is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 9 mats bergman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question A couple of questions...

Hi !

I have a couple of questions?

1) File Verify.php? missing or what, or have I missed something else?
Login.php...?
2)
If I would like to change the userlevel from 0 to 1 or 2(which will give the user some extra possibilities, for instance sending SMS! But when I go in to the DB (Mysql) and try too do this I cant to that this, wouldnt this be possible?
PHP Code:
<? 
session_start
();
echo 
"Welcome "$_SESSION['first_name'] ." "$_SESSION['last_name'] ."! 
    You have made it to the members area!<br /><br />"
;
echo 
"Your user level is "$_SESSION['user_level']." which enables 
    you access to the following areas: <br />"
;
if(
$_SESSION['user_level'] == 0){ 
    echo 
"- Forums<br />- Chat Room<br />"

if(
$_SESSION['user_level'] == 1){ 
    echo 
"- Forums<br />- Chat Room<br />- Moderator Area<br />"
}
echo 
"<br /><a href=logout.php>Logout</a>";
?>


3)The logmeot.php cant manage to get it working either...?
Doesnt show anything than the logmeout.php page and empty?

PHP Code:
<? 
session_start
();
if(!isset(
$_REQUEST['logmeout'])){ 
    echo 
"<center>Are you sure you want to logout?</center><br />"
    echo 
"<center><a href=logout.php?logmeout=true>Yes</a> | 
    <a href=javascript:history.back()>No</a>"

} else { 
    
session_destroy(); 
    if(!
session_is_registered('first_name')){ 
        echo 
"<center><font color=red><strong>You are now logged 
            out!</strong></font></center><br />"

        echo 
"<center><strong>Login:</strong></center><br />"
        include 
'login_form.html'
    } 

?>


Thanks for a good portal..
brother

Reply With Quote
  #28  
Old November 25th, 2003, 10:09 PM
Simon03 Simon03 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 Simon03 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Hi everyone

I tried this code and it all worked great...

I have a question.

the levels of users....

I noticed there are two levels, but no further explanation how these work...

How does one make use of those?

Thanks

Simon

Reply With Quote
  #29  
Old December 25th, 2003, 09:45 AM
rajuk rajuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 2 rajuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Creating Membership System

I could not find the zip file with the code along with article. Is there anyway I get that?

Thanks,
Raj

Reply With Quote
  #30  
Old December 27th, 2003, 12:58 PM
rajuk rajuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 2 rajuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
header function is not working

header("Location: login_success.php") is not working. Is there any suggestion to overcome?
I tried the different ways suggested by searching internet.
I am using internet explorer.

Thanks

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsCommunityDevelopment Tutorials > Article Discussion: Creating a Membership System


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap