Search Results

Search found 21350 results on 854 pages for 'url parsing'.

Page 41/854 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • How to extract URL parameters from a URL with Ruby or Rails?

    - by Flackou
    Hi, I have some URLs, like http://www.example.com/something?param1=value1&param2=value2&param3=value3, and I would like to extract the parameters from these URLs and get them in a Hash. Obviously, I could use regular expressions, but I was just wondering if there was easier ways to do that with Ruby or Rails. I haven't found anything in the Ruby Module 'URI' but perhaps I missed something. In fact, I need a method that would do that : extract_parameters_from_url("http://www.example.com/something?param1=value1&param2=value2&param3=value3") => {:param1 => 'value1', :param2 => 'value2', :param3 => 'value3'} Would you have some advices? Thanks in advance. Julien

    Read the article

  • php url routing question

    - by Ahmet vardar
    Hi, http://mysite.com/songs/company-name/song-name i want to redirect it to http://mysite.com/songs/index.php?name=company-name&song=song-name i read some articles about that mod_rewrite but actually i couldnt understand exactyly, i appreciate if you can help me. thanks

    Read the article

  • Generating a URL pattern when provided a set of 5 or so URLs

    - by ryan
    Provided with a set of URLs, I need to generate a pattern, For example: http://www.buy.com/prod/disney-s-star-struck/q/loc/109/213724402.html http://www.buy.com/prod/samsung-f2380-23-widescreen-1080p-lcd-monitor-150-000-1-dc-8ms-1920-x/q/loc/101/211249863.html http://www.buy.com/prod/panasonic-nnh765wf-microwave-oven-countertop-1-6-ft-1250w-panasonic/q/loc/66357/202045865.html http://www.buy.com/prod/escape-by-calvin-klein-for-women-3-4-oz-edp-spray/q/loc/66740/211210860.html http://www.buy.com/prod/v-touch-8gb-mp3-mp4-2-8-touch-screen-2mp-camera-expandable-minisd-w/q/loc/111/211402014.html Pattern is http://www.buy.com/prod/[^~]/q/loc/[^~].html

    Read the article

  • PHP File Upload using url parameters

    - by Arthur
    Is there a way to upload a file to server using php and the filename in a parameter (instead using a submit form), something like this: myserver/upload.php?file=c:\example.txt Im using a local server, so i dont have problems with filesize limit or upload function, and i have a code to upload file using a form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" enctype="multipart/form-data"> File to upload: <table> <tr><td><input name="upfile" type="file"></td></tr> <tr><td><input type="submit" name="submitBtn" value="Upload"></td></tr> </table> </form> <?php if (isset($_POST['submitBtn'])){ // Define the upload location $target_path = "c:\\"; // Create the file name with path $target_path = $target_path . basename( $_FILES['upfile']['name']); // Try to move the file from the temporay directory to the defined. if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['upfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } ?> </body> Thanks for the help

    Read the article

  • php website url matching question

    - by jj
    hi, i am new to a php site, only familiar with .net web forms sites. i can't figure out how routing is working on this php site. www.oursite.com/suggestions.php is to suggestions.php www.oursite.com/suggestions also loads the php fine www.oursite.com/suggestions/ loads the php, but no css is applied www.oursite.com/suggestions/anything - anything that comes after the '/' is ignored and suggestions is loaded without css. so oursite.com/suggestions////// works, as does oursite.com/suggestions/2/2/2/2/whatever i have searched but not found any good explanation on how this is working. can someone explain or provide a good resource? thank you.

    Read the article

  • How do I forward a request to a different url in python

    - by tax
    import SimpleHTTPServer import SocketServer class myHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): print self.path if self.path == '/analog': return "http://someserver.com/analog" return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) theport = 1234 Handler = myHandler pywebserver = SocketServer.TCPServer(("", theport), Handler) print "Python based web server. Serving at port", theport pywebserver.serve_forever()

    Read the article

  • django redirect url containing id

    - by dana
    hello, i want to add in my settings.py a declaration like: LOGIN_REDIRECT_URL='^private_profile/(?P<id>\d+)/$' #or LOGIN_REDIRECT_URL='/accounts/private_profile/id/' so that when the user with the id 1, for example,is logging in, he will be redirected to LOGIN_REDIRECT_URL='/accounts/private_profile/1/' but both alternatives, LOGIN_REDIRECT_URL='^private_profile/(?P<id>\d+)/$' #or LOGIN_REDIRECT_URL='/accounts/private_profile/id/' are wrong, because in my browser i don't see the current user id, where am i wrong? Thanks

    Read the article

  • Passing URIs as URL arguments in Drupal

    - by wynz
    I'm running into problems trying to pass absolute URIs as parameters with clean URLs enabled. I've got hook_menu() set up like this: function mymodule_menu() { return array( 'page/%' = array( 'title' = 'DBpedia Display Test', 'page callback' = 'mymodule_dbpedia_display', 'page arguments' = array(1), ), ); } and in the page callback: function mymodule_dbpedia_display($uri) { // Make an HTTP request for this URI // and then render some things return $output; } What I'm hoping to do is somehow pass full URIs (e.g. "http://dbpedia.org/resource/Coffee") to my page callback. I've tried a few things and nothing's worked so far... http://mysite.com/page/http%3A%2F%2Fdbpedia.org%2Fresource%2FCoffee Completely breaks Drupal's rewriting http://mysite.com/page/?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FCoffee Gives a 404 http://mysite.com/page/http://dbpedia.org/resource/Coffee Returns just "http:", which makes sense I could probably use $_GET to pull out the whole query string, but I guess I'm hoping for a more 'Drupal' solution. Any suggestions?

    Read the article

  • Convert url for crawler

    - by user260223
    Hi.. I'm working on a crawler. Usually, when i type url1 in my browser, browser converts it to url2. How can i do this in Python? url1: www.odevsitesi.com/ara.asp?kelime=doganin dengesinin bozulmasi url2: www.odevsitesi.com/ara.asp?kelime=do%F0an%FDn%20dengesinin%20bozulmas%FD

    Read the article

  • URL Redirection

    - by Paolo
    Hi pidors, I want to do it so that when someone follow the link www.mysite.pl/file1.mp3, hi gets redirected to www.mysite.pl/file2.mp3 but the adderes in his browser bar keeps the same. How to do it?

    Read the article

  • URL development and mod_rewrite

    - by iRector
    My site is made-up of the main page, and multiple sub-directories, all under the same domain. My URLS are currently like .................| Ideal clean version: mysite.com mysite.com/?content=content1 ......................| mysite.com/content1/ mysite.com/?content=content2&page=4 ........| mysite.com/content2/4/ mysite.com/?content=content3 ......................| mysite.com/content3/ mysite.com/?content=content4 ......................| mysite.com/content4/ mysite.com/?content=article&id=34 ............| mysite.com/article/34/ Then the sub-directories are essentially the same: mysite.com/subdir, mysite.com/subdir2, mysite.com/subdir3, etc mysite.com/subdir/?content=content1 ...................| mysite.com/subdir/content1/ mysite.com/subdir/?content=content2&page=4 .....| mysite.com/subdir/content2/4/ mysite.com/subdir/?content=content3 ...................| mysite.com/subdir/content3/ mysite.com/subdir/?content=content4 ...................| mysite.com/subdir/content4/ mysite.com/subdir/?content=article&id=34 .........| mysite.com/subdir/article/34/ I've used mod_rewrite briefly, but I'm not sure how to approach these multiple variables. Also, how would I differentiate between the actually subfolders, and the content variable. As so to prevent 'subdir' or 'subdir2' from being plugged in as the content variable for the root site. I've played around with plenty of code snippets, but I've wiped my .htaccess slate clean, and approach you all in an attempt to help me repopulate it. Your input would thoroughly be appreciated. Note: The only time the page query string will be needed is when 'content' == 'content2' ?content=content2&page=4 **Same rule is shared by the article/id relationship, all other 'content' values are expected to be dynamic.

    Read the article

  • Zend framework - duplication in translated url

    - by tomasr
    I have these URLs cz/kontroler/akce en/controller/action Is used transatable route and works it like charm. But problem is, that when you will write cz/controller/akce it works as well. In generally when you have cz/something-in-czech en/something-in-english which route to someController, will be works still cz/some en/some because it is really name of controller. How solve this duplicity content issue?

    Read the article

  • URL routing in an MVC framework - PHP

    - by Walderman
    I'm developing an MVC framework in PHP from scratch; mostly for the learning experience but this could easily end up in a live project. I went through this tutorial as a base and I've expanded from there. Requests are made like this: examplesite.com/controller/action/param1/param2/ and so on... And this is my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] So all requests go to index.php and they are routed to the correct controller and action from there. If no controller or action is given, then the default 'index' is assumed for both. I have an index controller with an index action, which is supposed to be the home page of my site. I can access it by going to examplesite.com (since the index part is assumed). It has some images, a link to a stylesheet, and some scripts. They are linked with paths relative to index.php. I thought this would be fine since all request go to index.php and all content is simply included in this page using php. This works if I go to examplesite.com. I will see all of the images and styles, and scripts will run. However, if I go to examplesite.com/index, I am routed to the correct part of the site, but all of the links don't work. Does the browser think I am in a different folder? I would like to be able to use relative paths for all of the content in my site, because otherwise I need to use absolute paths everywhere to make sure things will show up. Is this possible?

    Read the article

  • How to get image from relative URL in C#, the image cannot be in the project

    - by red-X
    I have a project where I'm loading relative image Uri's from an xml file. I'm loading the image like this: if (child.Name == "photo" && child.Attributes["href"] != null && File.Exists(child.Attributes["href"].Value)) { Image image = new Image(); image.Source = new BitmapImage(new Uri(child.Attributes["href"].Value, UriKind.RelativeOrAbsolute)); images.Add(image); } Where the "child" object is an XmlNode which could looks like this <photo name="info" href="Resources\Content\test.png"/> During debug it seemd images is filled with actual images but when I want to see them in any way it shows nothing. Weird thing is when I include the images in my project it does work, I however dont want to do that since my point for using an xml file is so that it would be lost since you'd have to rebuild the program anyway after a change.

    Read the article

  • Replace URL with a link using regex in python

    - by user122750
    how do I convert some text to a link? Back in PHP, I used this piece of code that worked well for my purpose: $text = preg_replace("#(^|[\n ])(([\w]+?://[\w\#$%&~.\-;:=,?@\[\]+]*)(/[\w\#$%&~/.\-;:=,?@\[\]+]*)?)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\3</a>", $text); $text = preg_replace("#(^|[\n ])(((www|ftp)\.[\w\#$%&~.\-;:=,?@\[\]+]*)(/[\w\#$%&~/.\-;:=,?@\[\]+]*)?)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\3</a>", $text); I tried around in Python, but was unable to get it to work.. Would be very nice if someone could translate this to Python :)..

    Read the article

  • Human readable URL causes a problem in Ruby on Rails

    - by TK
    I have a basic CRUD with "Company" model. To make the company name show up, I did def to_param name.parameterize end Then I accessed http://localhost:3000/companies/american-express which runs show action in the companies controller. Obviously this doesn't work because the show method is as following: def show @company = Company.find_by_id(params[:id]) end The params[:id] is american-express. This string is not stored anywhere. Do I need to store the short string (i.e., "american-express") in the database when I save the record? Or is there any way to retrieve the company data without saving the string in the database?

    Read the article

  • Page URL and database organization.

    - by shurik2533
    I want that its name would be the page address. For example, if page has heading "Some Page", than its address should be http://somesite/some_page/. "some_page"-name generated by system automatically. "some_page" - is the unique identifier of page. The problem in that the user in the future can enter a name which already exists that will cause an error. It is necessary to find an optimum variant of the decision of a problem for great volumes of the data. I have solved a problem as follows: The page identifier in a database is the name of page and a suffix which is by default equal to zero. At page addition there is a check on existence. If such page does not exist, the suffix is equal 0 and its name is "some_page", if page is exist, than - search for the maximum number of a suffix and suffix=suffix+1 and page name become "some_page_1". For this I create in a database the compound key from fields "suffix" and "pageName": Table Pages suffix|pageName |pageTitle 0 |some_page |Some Page 1 |some_page |Some Page 0 |other_page|Other Page Addition of pages occurs through stored procedure: CREATE PROCEDURE addPage (pageNameVal VARCHAR(100), pageTitleVal VARCHAR(100)) BEGIN DECLARE v INT DEFAULT 0; SELECT MAX(suffix) FROM pages WHERE pageName=pageNameVal INTO v; IF v >= 0 THEN SET v = v + 1; ELSE SET v = 0; END IF; INSERT INTO pages (suffix, pageName) VALUES (pageNameVal, v, pageTitleVal); END; Whether there are more the best decisions?

    Read the article

  • Manipulating/changing adressbar link Help

    - by Karem
    I am out of my own "ideas" going through this. I have a album viewer. When you click next I want the adressbar to hang with it, e.g if you start on ?photoid=1, and click next (next picture appends and stuff), and then i want it to say ?photoid=2. Now I cant make it say ?photoid=2 without changing/manipulating, and this you cant do without HTML5. I have made a script in HTML5 that works fine, but then I need to take care of those who dont have HTML5(only chrome, ff4 etc supports html5) Made the script from this( https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history ) I thought of adding #photoid=2 so, ?photoid=1#photoid=2 and then check if theres anything in # then use that instead of the $_GET.. But apparently you cannot do that as # is client side handled and never sent to the server. So what should I then do? Any suggestions please to make a workaround this? I checked facebook, what they did to IE users, and I could hear that it "clicked" (the annoying click sound from IE) twice.. the first was to get to the next picture, the second click sound changed the adressbar?!(how?). And then I also thought hey, html5 is only supported in ff4, and I got ff3.6, and they manipulate the adress bar url when you browse through the album photos, exactly like how I wanted (and what I have written for but it only works in Chrome and ff4..?). How could they do that?

    Read the article

  • Absolute URL Path for PHP Website

    - by kakaajee
    Hi friends, I am working on a website in a CMS site. I have provided a link in my footer file e.g blogs.php. This page is at the root like "http://www.example.com/new_cms/blogs.php" When I moves to other files link like "http://www.example.com/new_cms/forums" the footer link is changed to "http://www.example.com/new_cms/forums/blogs.php" but the blogs.php page resides at path "http://www.example.com/new_cms/" . I tried different $_SERVER[] variables but got no luck to get the above path "http://www.example.com/new_cms/" means the server name with the directory where the project is currently running from. Any one have idea how to get it done will be a great help. Thanks

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >