Search Results

Search found 19174 results on 767 pages for 'restful url'.

Page 72/767 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Cake PHP Routing issue

    - by Smickie
    Hi, I need to do some special routing in cake, but can't for the life of me figure it out. I have a shop controller at /shop, the format of the url will be: /shop/:category/:sub_category/:product_slug In the routing I need to send each part of the url to a different action, for example if the url was just /shop/cakes it would go to the category action of shop. However if the url was /shop/cakes/macaroons or /shop/cakes/fairy it would go to the sub category action on the shop controller. And the the same again for /shop/cakes/macaroons/pistachio would go to the product action on the shop controller. How would I go about this in the routing? Something starting with Router::connect('/shop/:category/:sub_category/:product_slug' ... Or am I way off the mark? Thanks.

    Read the article

  • 404 Error on a file that exists?

    - by Abs
    Hello all, A script makes a GET request to my URL like so: http://mydomain.com/cgi-bin/uu_ini_status_audios.pl?tmp_sid=b742be1d131c4d32237a9f1fcdca659e&rnd_id=0.2363453360320319 However, I get a 404 returned straight away: The requested URL /cgi-bin/uu_ini_status_audios.pl was not found on this server. But that script exists on my server, I can see the file! It has the correct permissions (I gave it a 777 to be sure). It is also owned by my apache user and its in the group apache. What am I missing?? Thanks for any help on this! Update I thought it would have been a htaccess (rewrite) but I don't think it is anymore. I tried putting a index.php file in there and try to access it via my URL but I can't even do that! I tried this: http://mydoamin.com/cgi-bin/index.php - same 404 error! I get this in myerror log: [Tue Sep 14 14:42:49 2010] [error] [client xx.xxx.xx.xxx] script not found or unable to stat: /var/www/vhosts/mydomain.com/cgi-bin Access_log file: xx.xxx.xx.xxx - - [14/Sep/2010:14:48:25 +0200] "GET /cgi-bin/index.php HTTP/1.1" 404 475 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)" Update 2 My htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^blog/ - [L] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L] RewriteRule ^search/(.*)/(.*)/(.*)/(.*) /search.php?searchfor=$1&sortby=$2&page=$3&searchterm=$4 RewriteRule ^confirmemail/(.*) /confirmemail.php?code=$1 RewriteRule ^resetpassword/(.*) /resetpassword.php?code=$1 RewriteRule ^resendconfirmation/(.*) /resendconfirmation.php?userid=$1 RewriteRule ^categories/ /categories.php RewriteRule ^([-_~*a-zA-Z0-9]+)(\/)?$ /memberprofile.php?username=$1 RewriteRule ^browse/audios/(.*)/(.*)/(.*)/(.*) /audios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^browse/categories/audios/(.*)/(.*)/(.*)/(.*) /categoryaudios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^audios/(.*)/(.*) /playaudio.php?audioid=$1&title=$2 RewriteRule ^download/audio/(.*)/(.*) /downloadaudio.php?AUDIOID=$1&title=$2 RewriteRule ^members/audios/(.*)/(.*) /memberaudios.php?pid=$1&username=$2 RewriteRule ^syndicate/audios/(.*)/(.*) /syndicateaudios.php?filter=$1&title=$2 </IfModule> Update 3 [root@smydomain ~]# ls -la /var/www/vhosts/mydoamin.com/httpdocs/cgi-bin/ total 60 drwxr-xr-x 3 apache root 4096 Sep 14 14:37 . drwxr-x--- 20 som psaserv 4096 Sep 14 14:40 .. drwxr-xr-x 2 apache root 4096 Sep 7 03:01 configs -rwxrwxrwx 1 apache root 4 Sep 14 14:37 index.php -rwxrwxrwx 1 apache apache 6520 Sep 7 03:01 uu_ini_status_audios.pl -rwxr-xr-x 1 apache root 3215 Sep 7 03:01 uu_lib_audios.pl -rwxr-xr-x 1 apache root 30249 Sep 7 03:01 uu_upload_audios.pl

    Read the article

  • How to stop htaccess rewrite rule carrying over query string

    - by geoffs3310
    I am setting up some redirects. I want to redirect the following URL: /cms/index.php?cat_id=2 to the following URL: /flash-chromatography The rule I currently have is as follows: RewriteCond %{QUERY_STRING} ^cat_id=2$ [NC] RewriteRule ^cms/index\.php$ /flash-chromatography [L,R=301] This rule is almost perfect apart from it redirect the URL to the following: /flash-chromatography?cat_id=2 So you see my problem is it has kept the ?cat_id=2 part when I don't want it to. How do I stop it keeping this bit?

    Read the article

  • How to supply parameters in URI schema?

    - by abhishekgarg
    I just started working with URI schema and successfully created one in Windows and Linux as well, but I am not able to parse any parameters to it. In Linux I am trying to open a file "test.py" in gedit, so for schema part I used these commands: gconftool -2 -t string /desktop/gnome/url-handlers/geditapp/command "gedit %s" gconftool -2 -t bool/desktop/gnome/url-handlers/geditapp/enabled true This is creating the URI protocol and I'm able to open the application with the Web-browser, but its not taking the parameters for the file I want to open, so I'm using the following command: <a href="geditapp:/opt/test/myfile.py">open</a> Which opens the gedit but without the file. Can someone please help me with this?

    Read the article

  • How to replace 'dash' with 'underscore' in an IIRF rule?

    - by jessegavin
    I have a web app which serves images based on the subdomain. We wanted to provide our users with a url like this: http://{username}.domain.com/images/myimage.jpg Instead of what we used to have: http://www.reallylongdomainname.com/users/{username}/images/myimage.jpg This makes the url shorter and less 'snoopable'. So I set up an IIRF .ini file to do some url rewriting and it works great except for the fact that some of our users folders have an underscore. And from what I've read, underscore is not a valid character in a domain name (even though IIS supports it). I want to know how I could do a find and replace in the $1 back reference so that a url like this: http://some-user.domain.com/... Could be rewritten to this: /users/some_user/.. Here's my IIRF rule. RewriteCond %{HTTP_HOST} ^(?!www)([^\.]+)\.domain\.com RewriteRule ^/(.*)$ /users/*1/$1 [L,I] Thanks for any help.

    Read the article

  • Servlet Mapping Help - Possible to Avoid Referencing Context Name?

    - by AJ
    Hi all, I am working on a Spring application and trying to get my URL mapping correct. What I would like to have work is the following: http://localhost:8080/idptest -> doesn't work But instead, I have to reference the context name in my URL in order to resolve the mapping: http://localhost:8080/<context_name>/idptest -> works How can I avoid the requirement of referencing the context name in my URL without using a rewrite/proxy engine e.g. Apache? Here is the servlet definition and mapping from my web.xml: <servlet> <servlet-name>idptest</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/conf/idptest.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>idptest</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> Here's the outline of my controller (showing annotations for request mappings): @Controller @RequestMapping("/idptest") public class MyController { @RequestMapping(method=RequestMethod.GET) public String setupForm(Model model){ MyObject someObject = new MyObject(); model.addAttribute("someObject", someObject); return "myform"; } @RequestMapping(method = RequestMethod.POST) public String processSubmit(@ModelAttribute("someObject") MyObject someObject) throws Exception { // POST logic... } } Thanks!

    Read the article

  • URL with no query parameters - How to distinguish.

    - by Broken Link
    Env: .NET 1.1 I got into this situation. Where I need to give a URL that someone could redirect them to our page. When they redirect they also need to tell us, what message I need to display on the page. Initially I thought of something like this. http://example.com/a.aspx?reason=100 http://example.com/a.aspx?reason=101 ... http://example.com/a.aspx?reason=115 So when we get this url based on 'reason' we can display different message. But the problem turns out to be that they can not send any query parameters at all. They want 15 difference URL's since they can't send query params. It doesn't make any sense to me to created 15 pages just to display a message. Any smart ideas,that have one URL and pass the 'reason' thru some means? EDIT: Options I'm thinking based on Answers Try HttpRequest.PathInfo or Second option I was thinking was to have a httphanlder read read the path like this - HttpContext.Request.Path based on path act. Ofcourse I will have some 15 entries like this in web.config. <add verb="*" path="reason1.ashx" type="WebApplication1.Class1, WebApplication1" /> <add verb="*" path="reason2.ashx" type="WebApplication1.Class1, WebApplication1" /> Does that look clean?

    Read the article

  • A simple way to redirect http://mysite.com to http://mysite.com/mylink with Apache?

    - by Bart Silverstrim
    Just starting to try to get the hang of how all the directives and options work under Apache. I'd like to do a redirect with my one site (only running one site on the server) so that when a request comes in to http://mysite.com the server automatically redirects them to a sub-url of http://mysite.com/mylink. I have tried putting redirects into the file located in /etc/apache2/sites-enabled to rewrite this, but then the top level domain URL complains it isn't redirecting properly. I think what I want is a browser redirect, and thought using RewriteEngine On RewriteRule ^/$ /mylink [L,R] would work, but putting it into an .htaccess file didn't work (it redirected but immediately gave a 500 internal server error.) Putting it into the file in /etc/apache2/sites-enabled gives a configuration error when trying to restart Apache. I know it's something simple...but what am I missing?

    Read the article

  • Enable Query Strings in Code Igniter

    - by tarnfeld
    Hey, I am trying to implement Twitter's OAuth into my Code Igniter web application at which the callback URL is /auth/ so once you have authenticated with Twitter you are taken to /auth/?oauth_token=SOME-TOKEN. I want to keep the nice clean URL's the framework provides using the /controller/method/ style of URL but I want to enable query strings as well, there will only ever be one name of the data oauth_token so it's ok if it has to be hard coded. Any ideas? I have tried tons of the things people are saying to do, but none work :( PS: I'm using the .htaccess method of URL rewriting.

    Read the article

  • Combine Search Bar and URL Bar into One (WebView)

    - by Jay Bush
    So I'm in the midst of updating my Web Browser app for iOS devices, from the ground up, and I'm trying to implement some more convenient features. One feature that seems to be really popular now, that I have been getting a lot of requests for, is the combination of a Google Search bar and a URL bar in one, like that of the Chrome application. Below is a screenshot of the Google Chrome app, and as you can see, they've made it so you can either enter in a search query like "apple ipad" and it will return a Google search page of 'Apple iPad', or you can enter in a URL "http://apple.com/ipad/" and it will load that URL. I have looked all over the internet, but all I could find were tutorials on how to Search Google with value of the UITextField. I have a feeling that the best way to do this is to probably make a 'check'. Like if the entered value contains 'http://' 'www.' '.com' or no spaces, then load it as a URL, if not then load it in a Google Search page, and then have the webview load up the Google Search page. If anybody could show me to the right direction, that would be great, or even supplying me with some code would be even greater. :) Thanks! If anyone needs part of the code, just ask.

    Read the article

  • Problem using unicode in URLs with cgi.PATH_INFO in ColdFusion

    - by Loftx
    Hi there, My ColdFusion (MX7) site has search functionality which appends the search term to the URL e.g. http://www.example.com/search.cfm/searchterm. The problem I'm running into is this is a multilingual site, so the search term may be in another language e.g. ??????? leading to a search URL such as http://www.example.com/search.cfm/??????? The problem is when I come to retrieve the search term from the URL. I'm using cgi.PATH_INFO to retrieve the path of the search page and the search term and extracting the search term from this e.g. /search.cfm/searchterm however, when unicode characters are used in the search they are converted to question marks e.g. /search.cfm/??????. These appear actual question marks, rather than the browser not being able to format unicode characters, or them being mangled on output. I can't find any information about whether ColdFusion supports unicode in the URL, or how I can go about resolving this and getting hold of the complete URL in some way - does anyone have any ideas? Cheers, Tom

    Read the article

  • Nginx fastcgi problems with django

    - by wizard
    I'm deploying my first django app. I'm familiar with nginx and fastcgi from deploying php-fpm. I can't get python to recognize the urls. I'm also at a loss on how to debug this further. I'd welcome solutions to this problem and tips on debugging fastcgi problems. Currently I get a 404 page regardless of the url and for some reason a double slash For http://www.site.com/admin/ Page not found (404) Request Method: GET Request URL: http://www.site.com/admin// My urls.py from the debug output - which work in the dev server. Using the URLconf defined in ahrlty.urls, Django tried these URL patterns, in this order: ^listings/ ^admin/ ^accounts/login/$ ^accounts/logout/$ my nginx config server { listen 80; server_name beta.ahrlty.com; access_log /home/ahrlty/ahrlty/logs/access.log; error_log /home/ahrlty/ahrlty/logs/error.log; location /static/ { alias /home/ahrlty/ahrlty/ahrlty/static/; break; } location /media/ { alias /usr/lib/python2.6/dist-packages/django/contrib/admin/media/; break; } location / { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:8001; break; } } and my fastcgi_params fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param PATH_INFO $fastcgi_script_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; And lastly I'm running fastcgi from the commandline with django's manage.py. python manage.py runfcgi method=threaded host=127.0.0.1 port=8080 pidfile=mysite.pid minspare=4 maxspare=30 daemonize=false I'm having a hard time debugging this one. Does anything jump out at anybody?

    Read the article

  • PHP URL parameters append return special character

    - by Alexandre Lavoie
    I'm programming a function to build an URL, here it is : public static function requestContent($p_lParameters) { $sParameters = "?key=TEST&format=json&jsoncallback=none"; foreach($p_lParameters as $sParameterName => $sParameterValue) { $sParameters .= "&$sParameterName=$sParameterValue"; } echo "<span style='font-size: 16px;'>URL : http://api.oodle.com/api/v2/listings" . $sParameters . "</span><br />"; $aXMLData = file_get_contents("http://api.oodle.com/api/v2/listings" . $sParameters); return json_decode($aXMLData,true); } And I am calling this function with this array list : print_r() result : Array ( [region] => canada [category] => housing/sale/home ) But this is very strange I get an unexpected character (note the special character none*®*ion) : http://api.oodle.com/api/v2/listings?key=TEST&format=json&jsoncallback=none®ion=canada&category=housing/sale/home For information I use this header : <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <?php header('Content-Type: text/html;charset=UTF-8'); ?> EDIT : $sRequest = "http://api.oodle.com/api/v2/listings?key=TEST&format=json&jsoncallback=none&region=canada&category=housing/sale/home"; echo "<span style='font-size: 16px;'>URL : " . $sRequest . "</span><br />"; return the exact URL with problem : http://api.oodle.com/api/v2/listings?key=TEST&format=json&jsoncallback=none®ion=canada&category=housing/sale/home Thank you for your help!

    Read the article

  • open a link in a new tab in the same window

    - by encryptor
    Hi I am making a firefox extension which needs to open a link in anew tab in the same window of firefox. How should i do this? This opens in a new window (replacing the old window): window.location = url; This opens in the same tab window.content.document.location = url Any idea on how to open the url in a new tab?

    Read the article

  • How to catch YouTube embed code and turn into URL

    - by Jonathan Vanasco
    I need to strip YouTube embed codes down to their URL only. This is the exact opposite of all but one question on StackOverflow. Most people want to turn the URL into an embed code. This question addresses the usage patttern I want, but is tied to a specific embed code's regex ( Strip YouTube Embed Code Down to URL Only ) I'm not familiar with how YouTube has offered embeds over the years - or how the sizes differ. According to their current site, there are 2 possible embed templates and a variety of options. If that's it, I can handle a regex myself -- but I was hoping someone had more knowledge they could share, so I could write a proper regex pattern that matches them all and not run into endless edge-cases. The full use case scenario : user enters content in web based wysiwig editor backend cleans out youtube & other embed codes; reformats approved embeds into an internal format as the text is all converted to markdown. on display, appropriate current template/code display for youtube or other 3rd party site is generated At a previous company, our tech-team devised a plan where YouTube videos were embedded by listing the URL only. That worked great , but it was in a CMS where everyone was trained. I'm trying to create a similar storage, but for user-generated-content.

    Read the article

  • Embed URL from variable in HTML file in Rails application

    - by TejasM
    hi, I have a doubt which might be silly for experience Rails developers. I am creating an application which is suppose to embed a video player with URL passed to it. So while displaying i.e in XXX.html.erb file i am writting below code. Now problem is @movie.trailer is my variable in ruby code which has URL value . I want the embedded video to load with URL given by this variable value. Any suggestion how am i suppose to place the value of Ruby variable(@movie.trailer) in part. <object width="425" height="344"> <param name="movie" value="<% @movie.trailer %>"> </param><param name="allowFullScreen" value="true"> </param><param name="allowscriptaccess" alue="always"> </param><embed src="<% @movie.trailer %>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object> Note :- This code is working perfectly fine if i statically give value of URL. Please help

    Read the article

  • Polymorphic urls with singular resources

    - by Brendon Muir
    I'm getting strange output when using the following routing setup: resources :warranty_types do resources :decisions end resource :warranty_review, :only => [] do resources :decisions end I have many warranty_types but only one warranty_review (thus the singular route declaration). The decisions are polymorphically associated with both. I have just a single decisions controller and a single _form.html.haml partial to render the form for a decision. This is the view code: = simple_form_for @decision, :url => [@decision_tree_owner, @decision.becomes(Decision)] do |form| The warranty_type url looks like this (for a new decision): /warranty_types/2/decisions whereas the warranty_review url looks like this: /admin/warranty_review/decisions.1 I think because the warranty_review id has no where to go, it's just getting appended to the end as an extension. Can someone explain what's going on here and how I might be able to fix it? I can work around it by trying to detect for a warranty_review class and substituting @decision_tree_owner with :warranty_review and this generates the correct url, but this is messy. I would have thought that the routing would be smart enough to realise that warranty_review is a singular resource and thus discard the id from the URL. This is Rails 3 by the way :)

    Read the article

  • How to redirect a form's get variables with IIS7

    - by Gareth
    Is it possible (and if so how) to redirect the url from a forms get variables into something more url friendly using IIS 7's URL Rewrite module. An example would be /Catalog/Search/Title=Something&Order=Price into /Catalog/Search/Title/Something/Order/Price Thanks for any suggestions

    Read the article

  • IIS7 Rewrite rule being duplicated across 2 different websites (unwanted)

    - by Matt
    We have a IIS7 on Windows Server 2008. It is hosting a handful of sites, on a handful of ip addresses. 2 of those sites are actually wildcards on the domain: *.firstdomain.com *.seconddomain.com However, I am finding that any URL Rewrite rules I add for one of these "websites", is automatically in the URL Rewrite section for the other. Similarly, if I disable the rule in in one, it disables in the other. This doesn't happen with the other sites defined on this server, just these two. I look at the parent (top level, the server as a whole), and the rule is not there. Any idea what's going on here?

    Read the article

  • ASP.NET MVC - hiding id in URL?

    - by mcfroob
    I'm building a basic blog application just now, for viewing data I'm just using the default route, i.e. - routes.MapRoute ( "Default", // Route name "{controller}/{action}/{id}", new { controller = "Blog", action = "Index", id = UrlParameter.Optional } ); So that when you go to mysite.com/View/12 it displays the blog with id 12. I want to modify the URLs so that they look as follows: mysite.com/View/2010/06/01/this-is-the-title. I could have a URL mapping like - routes.MapRoute( "View", "View/{year}/{month}/{day}/{title}", new { controller = "Blog", action = "View" } ); But then I'm not passing the ID into the Controller action so I would have to search on the date and title which doesn't feel right. On the other hand, if I pass the ID in it will show up in the URL which isn't what I'm aiming for either. Is there any way to redirect to the URL I want in the controller action after passing only the ID in as a paramter, or to pass the ID into the a Map Route but hide it in the URL? Thanks for your help!

    Read the article

  • DotNetOpenAuth getting return_To url as the provider

    - by Jeff
    I have a provider that I'm upgrading from version 2 to version 3. basically a user comes to one of our sites and we say "if you don't have an openID sign up with this one" They click that and are sent to our in house provider what signs them up for an account and has to verify their email address. In the link I send via Email I included the return to url . This way when they click the link to verify their email (sometimes up to a week later) they are sent to our page that knows to send them back to the returnTo to login. I could not find a good way to do this in version 2 so I used a hack. Sadly this hack broke in version 2 so I'm completely stumped as to how to find the login page url that is the return_To Note: I need the full URL not just the domain. old hack: if (ProviderEndpoint.PendingAuthenticationRequest != null) { req = ProviderEndpoint.PendingAuthenticationRequest.ToString(); int startpos = req.LastIndexOf("CheckIdRequest.ReturnTo = '"); startpos += "CheckIdRequest.ReturnTo = '".Length; int endpos = req.LastIndexOf("token=") - startpos-1; if (endpos > 0) { req = req.Substring(startpos, endpos); } else { log.Fatal("Missing token in url" + ProviderEndpoint.PendingAuthenticationRequest.ToString()); return "~/"; } req = req.Replace("&internalLogin=True", ""); req = req.Replace("?internalLogin=True&", "?"); req = req.Replace("?internalLogin=True", ""); }

    Read the article

  • Unexpected htaccess behaviour (mod_rewrite and apache)

    - by avastreg
    Yeah, mod_rewrite is driving me crazy. Here is the problem: my htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] when i try to access the page advantix (so address was www.mywebsite.com/advantix), i'm being redirected to advantix/?url=advantix Looking at the access log, i have a suspicious 301 in the middle "GET /advantix HTTP/1.1" 301 335 "-" "Mozilla/5.0" "GET /advantix/?url=advantix HTTP/1.1" 200 186 "-" "Mozilla/5.0" There is one important detail: advantix is a directory. So, if i comment that rule, advantix goes to the folder and list the files. Why it applies automatically the / if there's a folder matching? I don't want to reach the folder, i want to reach index.php?url=advantix with a call to advantix. I have the rewriteLogs too, but they didn't help more. My vhost conf has Directory tag with Options All, if helps, i don't know much about that.

    Read the article

  • Python: replace urls with title names from a string

    - by Hellnar
    Hello I would like to remove urls from a string replace them with their titles of the original contents. For example: mystring = "Ah I like this site: http://www.stackoverflow.com. Also I must say I like http://www.digg.com" sanitize(mystring) # it becomes "Ah I like this site: Stack Overflow. Also I must say I like Digg - The Latest News Headlines, Videos and Images" For replacing url to the title, I have written this snipplet: #get_title: string -> string def get_title(url): """Returns the title of the input URL""" output = BeautifulSoup.BeautifulSoup(urllib.urlopen(url)) return output.title.string

    Read the article

  • Failed to load url in Dom Document?

    - by Lakhan
    im trying to get latitude and longtitude from google map by giving address. But its giving error.when i directly copy url to browser url bar.its giving correct result.If anybody know the answer .Plz reply. Thanx in advance Here is my code. <?php $key = '[AIzaSyAoPgQlfKsBKQcBGB01cl8KmiPee3SmpU0]'; $opt = array ( 'address' => urlencode('Kolkata,India, ON') , 'output' => 'xml' ); $url = 'http://maps.google.com/maps/geo?q='.$opt['address'].'&output='.$opt['output'].'&oe=utf8&key='.$key; $dom = new DOMDocument(); $dom->load($url); $xpath = new DomXPath($dom); $xpath->registerNamespace('ge', 'http://earth.google.com/kml/2.0'); $statusCode = $xpath->query('//ge:Status/ge:code'); if ($statusCode->item(0)->nodeValue == '200') { $pointStr = $xpath->query('//ge:coordinates'); $point = explode(",", $pointStr->item(0)->nodeValue); $lat = $point[1]; $lon = $point[0]; echo '<pre>'; echo 'Lat: '.$lat.', Lon: '.$lon; echo '</pre>'; } ?> Following error has occured: Warning: DOMDocument::load(http://maps.google.com/maps/geo? q=Kolkata%252CIndia%252C%2BON&output=xml&oe=utf8&key=%5BAIzaSyAoPgQlfKsBKQcBGB01cl8KmiPee3SmpU0%5D) [domdocument.load]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in C:\xampp\htdocs\draw\draw.php on line 19 Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://maps.google.com/maps/geo?q=Kolkata%252CIndia%252C%2BON&output=xml&oe=utf8&key=%5BAIzaSyAoPgQlfKsBKQcBGB01cl8KmiPee3SmpU0%5D" in C:\xampp\htdocs\draw\draw.php on line 19 Notice: Trying to get property of non-object in C:\xampp\htdocs\draw\draw.php on line 26

    Read the article

  • How to correct this rewrite rule?

    - by Justin John
    I have url as http://www.mydomain.com/levels/home?mode=48bb6e862e54f2a795ffc4e541caed4d. I need to change this url to http://www.mydomain.com/medium. I am not familiar with rewrite url. I tried with RewriteRule ^medium/?$ levels/home?mode=48bb6e862e54f2a795ffc4e541caed4d, but not worked correctly. Full rewrite rule RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^medium/?$ levels/home?mode=48bb6e862e54f2a795ffc4e541caed4d RewriteRule ^(.*)$ index.php [QSA,L]

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >