Solved

encoding & for passing through the query string

Posted on 2014-07-24
1
197 Views
Last Modified: 2014-07-24
I have a lookup capability that uses the query string to pass the string typed into the web page to a php lookup using ajax.

The "&" is often a part of the string.

Is there a Javascript way to "urlencode" the query string & then "decode" it in php?

Thanks
0
Comment
Question by:Richard Korts
1 Comment
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40218160
encodeURIComponent(querystring)

Open in new window

<?php
$var = urldecode($_GET['var']);

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

820 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