View Full Version : get name from linkedin website and use it to send in email based on URL

01-15-2010, 12:28 AM

I developed a snippet of code to originally use for a landing page and prepoulated form.

I am now reusing this code to capture who visits my site based on an email invite.

Below is the code I use; the end result of the code is to send me an email when the person I had sent an email to has clicked on the link to visit my site...

I would send them a link by email (inviting them to view my site). The URL looks like this:


When they click on the link, I receive an email that looks like this:



John Smith of ACME is viewing your online portfolio.

His/Her contact information is:

Name: John Smith
Company: ACME
Email: jsmtih@acme.com


Below is the code I use:


// Change these two variables to meet your needs.

$myemail = 'myemail@mysite.com';
$subject = 'Portfolio Viewing ALERT - You An Online Visitor';
$emailrn = 'myemail@mysite.com';
$firstname = $_GET[first];
$lastname = $_GET[last];
$company = $_GET[company];
$position = $_GET[position];
$email = $_GET[email];
$id = $_GET[id];
$op = $_GET[op];
if($op == 'contact')
$header = "From: $emailrnReply-To: $emailrn";
$message = "Michael,

$firstname $lastname of $company is viewing your online portfolio.

His/Her contact information is:

Name: $firstname $lastname
Company: $company
Email: $email";

if(mail($myemail, $subject, $message, $header))
$status = "Has been approved.<br><br>";


I would like to expand this code to do the following:

I would like to create a URL that I can post into my "add your website" in my "LinkedIn" profile page. That is not the issue...my dream is to somehow get the persons name who clicked the "view website" and have it be sent to me through the php email. Can this be done? The image below is where I would like the link to be.


I do not know how to capture the persons name (they would need to be logged into their account to view my full profile)...not even sure if it can be done; but wouldn't it be nice?


01-15-2010, 12:36 AM
Unless you have access to the linked in websites data you cannot do this no