View Full Version : PHP Anyone ????


zombie_002
09-27-2006, 09:18 PM
Hi, I am new to php I know enough to get the site up and running, what i need help with is getting it so that when someone goes to register on my site that it actualy sends them and email to active there account. I have no idea what i need to do to fix it i have tried 4 different email acounts (hotmail,yahoo,vcn,&my work bighorntravel.com) and none of the recieved any kind of activation email my wife has even tried and got nothing, could someone please help me and tell me were i need to go and how to fix it please. thank you much

my website is no advertising if you want to see what i mean buy it does not send you an email. I was reading through some of these forums old post is it because i am using a free hosting company that doesnt allow it.

Licorne
09-29-2006, 02:36 AM
Maybe there is a problem with the php script you are using? A snippet of the code here would be nice.

Idiotic Creation
10-01-2006, 12:12 AM
Well, your saying fix it, so if you already have a code maybe you could post it and we could help you.

If you want to know how to send an email after registration, look at this. It is a simple one that I made.
//Mail Confirm
if ($ipcheck && $usernamecheck && $fieldscheck && $codecheck) { // Ok, you can ignore this part, but it is just checking weather or not the user left any fields blank.
$to = $email; //make a variable called 'to' and then it will equal the user email address, which is stored in $email
$subject = "Thank You"; //make a variable called 'subject' and it will be the subject
$message = "Dear $firstname,
Thank you for registering....
Regards,
....."; //make a variable called 'message' and it will be the body of the email
$from = "admin@musicsource.xenweb.net"; // make a from variable and make it your email address, im prettysure that it has to be an email that is on your domain, so you couldnt send it from hotmail, or gmail.
$headers = "From: $from"; //Ummm i dont rember what this is for xD....but you need it
mail ($to,$subject,$message,$headers); //Then use the mail function
} Ok, and remember, this is very basic, so it is vunarable to spam and such....but it works.

Ok now is what you wanted was an email verification, so in the body of the email you need to put a link to a page on your website that will valiadate them.

Ok and I have never done anyhting like this before so I'm just going on theory now.

Ok in your user database you should have a field for whether or not the user is varified. When the account is first created that field is marked false or no. Then you need some way to identify the user. I would use IP address, but there is probably a better way. So you should also have a field for the user ip

Then when the user follows the link through your email, and they access your validation page it checks to see if their ip is the same as any of the un validated users ip, if it is then it changes the status from false to true, or no to yes.

Then you give them a nifty little message like, "Your account is now active"

So, if you need a better explaniation. I recomend Douglas he is awesome at php.

EDIT: Oh, I just realized that I used the terms valiadted and varified interchangable. I hope I didnt confuse you =P

Good Luck,
David

bejayel
10-03-2006, 05:44 AM
validate and verify are totally different :P. (they are in my comp sci classes anyway lol).

Either way. This person doesnt have access to the mail() function in php. If you want an mail sent automatically, you will need to fin da different host that lets you use the mail function.

Oh, just to let you know so you dont try like 9 million different hosts. You wont find one in all likely hood. Most free hosts remove the mail() functionality because spammers would take advantage of the free transfer. If you happen to find one: Good on ya man.

zombie_002
10-03-2006, 08:57 PM
validate and verify are totally different :P. (they are in my comp sci classes anyway lol).

Either way. This person doesnt have access to the mail() function in php. If you want an mail sent automatically, you will need to fin da different host that lets you use the mail function.

Oh, just to let you know so you dont try like 9 million different hosts. You wont find one in all likely hood. Most free hosts remove the mail() functionality because spammers would take advantage of the free transfer. If you happen to find one: Good on ya man.

thank you that is what i was starting to think that it doesnt work with free host.

Idiotic Creation
10-04-2006, 03:25 AM
im prettysure that it has to be an email that is on your domain
I guess I did answer his question. Just accidently.