PHP parsing email address

Hi Experts,

I've a HTML email which I email out to people to click on the link.

How do I embed the person's email into the link in the HTML email when clicked to parse into the PHP form?

eg: If the person who opens the email, his email is john@doe.com, when he opens this email and click on the link to go to the webpage, his email will be automatically populated on the webpage textfield saying "john@doe.com"

this is the code

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta id="viewport" name="viewport">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
       <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Pre qualification email</title>
        <link rel="stylesheet" href="http://www.personalclaimline.com/css/main.css">
        <link href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic" rel="stylesheet" type="text/css">
         <!--[if lte IE 9]>
          <script type="text/javascript" src="http://www.personalclaimline.com/js/html5shiv.js"></script>
        <![endif]-->

     
</head>
    <body background="http://www.personalclaimline.com/img/form-background.jpg">
    
    <div class="jquery-script-ads" align="center"> </div>
      <main>
    
   
      
      
      
        <h1>Urgent: Pre qualification email</h1>
   
   
	  
          <p>Mr. Mrs_________<br>
            Claim no: Euroclaim SG/023</p>
          <p>In the world of corporate  litigation, information is power. Please click &ldquo;yes&rdquo; or &ldquo;no&rdquo; on your personal self  assessment form below to assist us to maximise your claim.<br>
            You may qualify for up to  four times your loss in compensation on top of your refund. <br><br>
            Under: <u>Section 340, Chapter 20 of the Companies Act</u><br>
            Your company may have  committed the following breaches of law: </p>
          <p align="center"><em>Criminal Breach of Trust, Material  Harm, Defraudulent Trading.</em></p>
<p class="form-help-text">&nbsp;</p>
<form>
        <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
          <legend>Qualify for refund:</legend>
          If you can't see the rest of the form please <a href="http://www.personalclaimline.com/email.php?to=feedback@personalclaimline.com">click here</a> to qualify for your refund + 400% compensation.
</fieldset>
      </form>   
      </main>
      
    
    </body>
</html>

Open in new window

sharepoint2015Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

InsoftserviceCommented:
Please correct me if i am wrong you want a popup when clicked on "click here" link.
I have provided a small script try if it suits ur criteria. please note its not aligned properly its just a basic display of popup after clicking the link.
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta id="viewport" name="viewport">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
       <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Pre qualification email</title>
        <link rel="stylesheet" href="http://www.personalclaimline.com/css/main.css">
        <link href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic" rel="stylesheet" type="text/css">
         <!--[if lte IE 9]>
          <script type="text/javascript" src="http://www.personalclaimline.com/js/html5shiv.js"></script>
        <![endif]-->
<script type="text/javascript" src="http://www.lovetomarry.com/media/scripts/jquery-1.4.2.js?v=1"></script>
<script type='text/javascript'>
   function openpopup(email)
   {
            $('#popupid').html(email);
    		$('#popupshowid').show();
   }

  

</script>
<style>
   
.popup {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #CCCCCC;
    font-weight: normal;
    padding-top:0px;
    padding-left: 25px;
    padding-right: 23px;
	padding-bottom:23px;
    width: 330px;
	height:550px;
	position:absolute;
	left: 300px;
    top: 300px;
	z-index: 3002;
}
.shadow {
	box-shadow: 2px 3px 4px #777777;
	-webkit-box-shadow: 2px 4px 4px #777777;
	-moz-box-shadow: 2px 3px 4px #777777;
	filter: progid:DXImageTransform.Microsoft.dropShadow(color=#818181, offX=2, offY=3, positive=true);
}

.shadowdiv {
	box-shadow: 1px 0px 7px #777777;
	-webkit-box-shadow: 1px 0px 7px #777777;
	-moz-box-shadow: 1px 0px 7px #777777;
	filter: progid:DXImageTransform.Microsoft.dropShadow(color=#818181, offX=1, offY=0, positive=true);
}
</style>
     
</head>
    <body background="http://www.personalclaimline.com/img/form-background.jpg">
    
    <div class="jquery-script-ads" align="center"> </div>
      <main>
    
   
      
      
      
        <h1>Urgent: Pre qualification email</h1>
   
   
	  
          <p>Mr. Mrs_________<br>
            Claim no: Euroclaim SG/023</p>
          <p>In the world of corporate  litigation, information is power. Please click &ldquo;yes&rdquo; or &ldquo;no&rdquo; on your personal self  assessment form below to assist us to maximise your claim.<br>
            You may qualify for up to  four times your loss in compensation on top of your refund. <br><br>
            Under: <u>Section 340, Chapter 20 of the Companies Act</u><br>
            Your company may have  committed the following breaches of law: </p>
          <p align="center"><em>Criminal Breach of Trust, Material  Harm, Defraudulent Trading.</em></p>
<p class="form-help-text">&nbsp;</p>
<form>
        <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
          <legend>Qualify for refund:</legend>
          If you can't see the rest of the form please <a href="javascript:void(0)" onClick="javascript:openpopup('feedback@personalclaimline.com')">click here</a> to qualify for your refund + 400% compensation.
</fieldset>
      </form>   
      </main>
	  <div class="popup shadow" style="display:none" id="popupshowid">
	     Welcome <span id='popupid'></span>
	  </div>
      
    
    </body>
</html>
                                  

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
Have a look at this article.  The web server that contains the "handshake" script can prepopulate any field in the HTML form as it generates the page (any field except FILE, but that's not in play here).
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_3939-Registration-and-Email-Confirmation-in-PHP.html

If you follow this design, the server has control over the data that goes into the form, and there is less risk of tampering with the email message.
0
sharepoint2015Author Commented:
let me try it.
0
Adrian HealCommented:
Hello sharepoint2015,
So the PHP that creates the email HTML needs to add the email address into the link before it sends the email. It needs to be added during the email construction. This way, when the link is clicked you are passing the email address as a parameter to the websites form page (which will pop-up in a new browser window). When the person clicks the link it already should have the email address included as a parameter. The page with your form then retrieves the parameter and uses it to populate the appropriate HTML label, input box, or variable.

<a href="http://www.personalclaimline.com/email.php?to=feedback@personalclaimline.com">click here</a>

In the code above that you have included it looks like you have already done this. Perhaps you did this manually as an example. Inserting the address into the link during email construction is simple string building. You may already know how to do this. Just in case, I will explain...

<?php
$theemailaddress="feedback@personalclaimline.com";
echo "<a href=\"http://www.personalclaimline.com/email.php?to=".$theemailaddress."\">click here</a>";
?>

Notice where " is echoed we use the \ escape character. This tells the echo to include the " in the string so that the string does not end. Using the . to concatenate variables to a string makes the variable stand out so that it is easier to read.

Hope this helps. Worth a try.
0
p_nutsCommented:
let's keep it simple..

you've got an email with a link http://www.personalclaimline.com/email.php?to=feedback@personalclaimline.com

on the page email.php the "to" variable is avialable through $_GET['to']

so if you want to use that furtheron or want to display it just use that.

if you want to change the to variable to an ID stored in the DB that's pretty easy too but you are probably better off using ray's registration article and make it a full blown registration.

P_nuts
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.