Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

autopopulating emails into unsubscibe html forms

 
Pat Bailey
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic