Hello, I have code that written in PHP. Can anyone help me to translate it to ASP? $url = $_SERVER['HTTP_REFERER']; preg_match("/\&q=(.*?)\&/", $url, $matches); $str = $matches[1]; echo "str: $str <br />"; PHP: Thank...
Would be much easier to say what you're trying to achieve than giving some PHP (which doesn't mean anything to me) Request.UrlReferrer.Query will return the the full querystring for the referer, you then just need to do a match against the string to get the value of Q
I don't think so, but lets try: I getting url string, for example: http://www.google.com/#hl=en&source=hp&q=roi&aq=f&aqi=g10&aql=&oq=&gs_rfai=&pbx=1&fp=93c3c78db929eee0 PHP: How can I get into variable the string between "&q" and "&" (in this example it's: "roi"), using ASP?
Hi NeoRu, I'm not familiar with ASP code. Is it possible for you to translate the 3-4 lines that I wrote, in PHP, to ASP?
I have already given the command that will bring back the querystring (hl=en&source=hp&q=roi&aq=f&aqi=g10&aql=&oq=&gs_rfai=&pbx=1&fp=93c3c78db929eee0 in your example) and therefore you need to just use regular expressions to get the Q value - see the following link http://www.regular-expressions.info/dotnet.html
I posted an asp.net function to do this a while ago, but if you want it in classic asp then similar principles apply: http://forums.digitalpoint.com/showthread.php?t=1251909