cyfer65 Posted June 20, 2009 Report Share Posted June 20, 2009 Is there a way to get a URL variable from the "URL=" Parameter in a URL like "http://www.site.com?URL=http://www.google.com"and then use this $URL variable in an iframe..?? Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted June 21, 2009 Report Share Posted June 21, 2009 If the url parameter is the only parameter in the URL, you can just use substr() to get the last characters of the string. Otherwise you will need to use more complex regular expressions to find where the url parameter begins and ends. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2009 Report Share Posted June 22, 2009 These are the properties you can use for the window.location object:http://www.w3schools.com/htmldom/dom_obj_location.asp Link to comment Share on other sites More sharing options...
Ingolme Posted June 22, 2009 Report Share Posted June 22, 2009 You don't need regular expressions to get values from the query string. Here's a simple method: // Remove '?' from the query stringvar i, q;var query = location.search.substr(1)// separare variablesquery = query.split("&");var $_GET = new Object();for (i = 0; i < query.length; i++) { q = query[i].split("="); $_GET[q[0]] = q[1];} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now