[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2014-12-09
8
Medium Priority
?
109 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 84

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 84

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

656 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