|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: Creating a Membership System
Creating a Membership System If you have any questions or comments about this article please post them here.
You can read the article here . |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
also, did you know that the second page is copied 2 times? Great article, very simple and easy to follow! THanks!
Paul |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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:
Change it to this: PHP Code:
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
Page 2 of this article has been changed. Sorry about this inconvience. Thank you Paul, well spotted.
|
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
|||
|
|||
|
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 |
|
#12
|
|||
|
|||
|
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 |
|
#13
|
|||
|
|||
|
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 |
|
#14
|
|||
|
|||
|
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 |
|
#15
|
|||
|
|||
|
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 |
|
#16
|
|||
|
|||
|
what does line 43 look like?
Copy and paste that into here. Paul |
|
#17
|
|||
|
|||
|
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 |
|
#18
|
|||
|
|||
|
hello,
try replace <a href="lost_pw.html"> with <a href='lost_pw.html'> NOTE: Single quotes |
|
#19
|
|||
|
|||
|
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? |
|
#20
|
|||
|
|||
|
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
|
|
#21
|
|||
|
|||
|
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 |
|
#22
|
|||
|
|||
|
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! |
|
#23
|
|||
|
|||
|
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
|
|
#24
|
|||
|
|||
|
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?
|
|
#25
|
|||
|
|||
|
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 12:09 AM. |
|
#26
|
|||
|
|||
|
Can we download the files complete some were?
|
|
#27
|
|||
|
|||
|
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 |
|
#28
|
|||
|
|||
|
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? |
|
#29
|
|||
|
|||
|
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:
3)The logmeot.php cant manage to get it working either...? Doesnt show anything than the logmeout.php page and empty? PHP Code:
Thanks for a good portal.. brother |
|
#30
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Community > Development Tutorials > Article Discussion: Creating a Membership System |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|