• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

autopopulating emails into unsubscibe html forms

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic