Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email form

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
I'm sending a form using php. I want to send an receipt email to an email address that is entered in the form. It doesn't seem to work to just add a varible name that is filled out in the form and add it to toaddress.
How would you do it then...

$toaddress = $emailaddress;
 
If I'm understanding you correctly., then you need to use the POST variable to access your form data.
Code:
$toaddress=$_POST['emailaddress'];

assuming your form's method is POSt, if not you can use the GET variable

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yes, thanks. How do you send it to an email address AND an email address from the form?
 
You can use the mail function.
Code:
mail($to,$subject,$message);
or PHPmailer if you want more control over what you send.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top