aspose file tools*
The moose likes Java in General and the fly likes autopopulating emails into unsubscibe html forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "autopopulating emails into unsubscibe html forms" Watch "autopopulating emails into unsubscibe html forms" New topic
Author

autopopulating emails into unsubscibe html forms

Pat Bailey
Greenhorn

Joined: Jun 11, 2009
Posts: 1
I am in the process of learning javascripting and need some assistance with autopopulating fields.

I have created several email campaigns which are in html. I then send these out to an email listing with an unsubscribe.html.

I would like to find out what to do to make the responder's email autopopulate into the email field within a form in the unsubscribe html form.

the unsubscribe php looks like this currently:

<?php
// get posted data into local variables
$EmailFrom = "inquiry1@balancedfootprint.com";
$EmailTo = "unsubscribe1@balancedfootprint.com";
$Subject = "Website Contact Form Response";
$Email = Trim(stripslashes($_POST['Email']));
$DescriptionofInquiry = Trim(stripslashes($_POST['DescriptionofInquiry']));

// validation
$validationOK=true;
if (Trim($Email)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "\n";

// send email
$removal = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to removal page
if ($removal){
print "<meta http-equiv=\"refresh\" content=\"0;URL=removal.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>


thanks for any assistance.

PB
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60999
    
  65

Welcome to the Ranch.

But, please take the time to choose the correct forum for your posts. This forum is for questions on advanced Java. For more information, please read this.

This post has been moved to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41522
    
  53
It sounds like the unsubscribe link would need to contain the mail address, and then the PHP page would take parameter and do with it whatever needs doing.

That's insecure, though, because people could unsubscribe anybody from the list who's address they can guess, just by manipulating the link.

The safer way to do this would be to embed something in the URL that's cryptologically secure (like the encrypted address).


Ping & DNS - my free Android networking tools app
 
 
subject: autopopulating emails into unsubscibe html forms