tmallen Posted October 26, 2007 Share Posted October 26, 2007 I have a form I've been using for a couple years to send email to me as feedback from my website. Now I'd like to use it to save a subscriber's information for a mailing list. Ideally, it will be moved into an XML file that I can easily output with XSLT. Anyway, here's the script. What would I need to modify to make this change? Not that the print line at the end is just there as a placeholder for a true redirect page. <?php # Mailing List Script for {recipient} by {my name} 2007 $to = 'myemail@myemail.com'; $subject = 'Mailing List Signup'; $mailheaders = 'From: websiteURL'; // Grab the form and assign to variables $name = $_REQUEST['name']; $company = $_REQUEST['company']; $title = $_REQUEST['title']; $address = $_REQUEST['address']; $address2 = $_REQUEST['address2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $phone = $_REQUEST['phone']; $email = $_REQUEST['email']; // Send the mail $body = "Name: " .$name."\n". "Company: " .$company."\n". "Title: " .$title."\n". "Address: " .$address."\n". "Address 2: " .$address2."\n". "City: " .$city."\n". "State: " .$state."\n". "Phone: " .$phone."\n". "Email: " .$email."\n"; mail ($to, $subject, $body, $mailheaders); print "sent successfully!"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/74924-dump-form-data-to-a-text-or-xml-file/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.