Hi All,
I've got a small shareware program with a few users and I need to set up a 'Retrieve your registration details' form. I've been told that PHP is the way forward. The idea is a form that the users enter their username or email into and the PHP script mails them their registration details which it gets from a MySQL database.
Not rocket science but I'm not a PHP programmer. I'll manage the SQL by myself.
Can anyone point me to a code snippet that resembles this requirement?
Thanks,
Wilson Logan.
PHP MySQL lost password code
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: PHP MySQL lost password code
1. Create a form with the fields you require.
2. Get the input values:
Does this make sense? If so i'll show you how to send the email.
2. Get the input values:
Code: Select all
$frmErr=0;
if(isset($_POST['submit']))
{
//check if value was entered
if(!empty($_POST['email']))
{
$email=$_POST['email'];
//get user's details via query
}
else
{
$frmErr=1;
}
//if there are no errors then send details
if($frmErr==0)
{
//send email
}
}
Re: PHP MySQL lost password code
OK, thanks. Thats great.
I've got my form up & going with the PHP.
I suppose now I need to know how to connect to the database and send the email. I will be able to write the SQL query.
I have MySQL and Linux.
Cheers,
Wilson.
I've got my form up & going with the PHP.
I suppose now I need to know how to connect to the database and send the email. I will be able to write the SQL query.
I have MySQL and Linux.
Cheers,
Wilson.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: PHP MySQL lost password code
Write your query then post it.
We'll then put it all together.
We'll then put it all together.
Re: PHP MySQL lost password code
Okay doaky.
I'll post again when I've got it ready.
Wilson.
I'll post again when I've got it ready.
Wilson.