• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 433
  • Last Modified:

[PHP] $_GET data clear

I am creating a form that will work as a search form for a database, and I wanted to use get as the method for getting the information so that they could bookmark the searches.  The problem is that some of the residual data is left over from search to search.  

I can reset the headers on the page to only show the data that I want, but I was wondering if that was the most secure/best way to do this or if there is something else that people do to remove the extra data from the URL.

Thanks so much!
0
prileyosborne
Asked:
prileyosborne
1 Solution
 
Hugh McCurdyCommented:
Against whom are you trying to secure information?  What type of information are you trying to secure?  Are you adding information you want to keep secret to the URL?  (That's the only thing that makes sense to me so far because the user knows his own search.)

If you are adding information to the URL that should be secret, I suggest you store the secret information in a session variable ($_SESSION).  This sets a cookie that expires when either your software expires it or when the browser closes (whichever comes first).  Banks use session variables.  Nothing is 100% secure but they are pretty good if you are careful.

See http://www.w3schools.com/php/php_sessions.asp
0
 
Scott MadeiraCommented:
Just because they are sending you data that doesn't mean you need to process it.  You can always ignore the extra data that is coming in the request.
0
 
prileyosborneAuthor Commented:
Oh, great link on Sessions.  So I can just unset the session every time I change the search. That works perfectly!  Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now