?
Solved

how to get the Get variables from a link clicked in an email

Posted on 2014-12-09
8
Medium Priority
?
103 Views
Last Modified: 2014-12-15
Hi

How do i get the get variables from a link clicked in an email?

I've seen parse_str but i dont know how to make sure the data is safe

do i use html_special_chars or strip_tags or preg_replace.i I was thinking something like this...assuming here just one variable $data


$data = strip_tags($data');
$data = preg_replace('/on[a-z]+=\".*\"/i', '', $data);

Thank you
0
Comment
Question by:andieje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40490125
Example link?
If it's just standard querystring name pairs then

    $name = $_GET['name'];
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40490130
It is no different than a link with a query string in a web page.  You use the $_GET variables to retrieve them.  This page shows simplified ways of handling them: http://www.w3schools.com/php/php_forms.asp   There is also a page there about handling email variables and checking them.
0
 

Author Comment

by:andieje
ID: 40492566
How do i make them safe? I want one of the get variables to be an email. thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:Gary
ID: 40492572
Safe to do what?
0
 

Author Comment

by:andieje
ID: 40492581
safe to store in datbase and then echo to string

I want all javascript tags removing and to be on the safe side all html takgs too for now please


I didnt know what to do wht the @ and - and _ and chracters like that in an email address

thanks.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40492584
Use strip_tags

    $email = strip_tags($_GET['email]);

I didnt know what to do wht the @ and - and _ and chracters
You don't do anything, they are valid in email adresses
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40492714
I agree with Gary.  I have hundreds of forms out there that have email addresses as inputs.  You must accept those characters in an email because they are valid parts of an email.  This page http://en.wikipedia.org/wiki/Email_address shows what characters are valid in an email address.
0
 

Author Closing Comment

by:andieje
ID: 40501553
excellent
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question