Jump to content

Add email address to register.php


rscott7706

Recommended Posts

Hi all...

 

I have a registration page for our members only area that works perfectly, except I want to add the registrants email in addition to existing info.

 

What I have now is a validation setup.  When the registrant clicks send, it sends and email to the site administrator, with a link to automatically change the MySql validation field from 0 to 1.

 

But, only current site members can gain access to the members only area.  So I need the registrants email in the validation email so our site administrator can send them an application to join the site prior to validating them for the members only area.  The email variable is $email

 

Too much info?

 

Anyway, here is the truncated coding - I can post the whole script if necessary:

==============================================================

if (mail ("admin@egca.org", "Confirm EGCA Members Only Registration","Dear EGCA Administrator.\n\n

 

If this is not a current EGCA Member, please send them an application package.  Email=<need to put their email right here )$email)>\n\n

 

If this is a current EGCA member, click on the link below to activate their membership.\n\n

 

If you are unable to click on the link, just paste the url given below in the address field of your browser and press enter to activate this account.\n\n

$path/activate.php?email=$email&password=$password&key=$validkey","From: no-reply@egca.org"))

==============================================================

 

Hope this is clear yet not too wordy.....

Link to comment
Share on other sites

OK, thanks.

 

Every thing is working, except the existing code does not have the registrants email coded in.  Right where I have the red comment, I need to put the variable "$email" so it appears in the email that is sent to the site administrator.

 

This way, if the person registering is not a current site member, and is trying to gain access to the members only area, the site administrator can send them an email with an Adobe Acrobat application to join EGCA.

 

So, if the registering person is an existing member, the adminitrator simply clicks on the validation link below, if not she sends the person an email.

 

I hope that clears it up some.

Link to comment
Share on other sites

Edit:  I just reread your post, and I don't think this will help....

 

Anyway, I think you need to post more code so we can see where things are getting defined.

 

 

You'll need to get their email address and store it in your database.... Forexample:

 

//first off run something like:
/*
ALTER TABLE your_table ADD email varchar(50)
*/
//then you'll need to add the email field to your reg form:
echo '<form action="some place" method="method here">
<!-- some other stuff here -->
<input type="text" name="email" value="" maxlength="50" />
<!-- maybe some more fields and a submit button here -->
</form>';

//then your processing could look something like this (no error checking or anything in this example):
mysql_connect(blah, blah, blah);
mysql_select_db(blah);
//define all the stuff to variables and clean them or what ever....
$email = $_GET['email'];
if(mysql_query("INSERT INTO your_table (`name`, `password`, `email`) VALUES ('{$name}', '{$password}', '{$email}')")) { //basically you would just need to alter your insert statement to include the email address
echo 'Success';
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.