url

How do I access a JPG embedded in my JAR file via a URL object? What would be the address?

I've bundled a JPG inside of my application's JAR file. I need to access it, preferably via a URL object from the code in the same JAR. But I've no idea how to construct the address. I'm guessing it would be a "file:///" but what comes after that? ...

Unicode characters in URLs

In 2010, would you serve URLs containing UTF-8 characters in a large web portal? Unicode characters are forbidden as per the RFC on URLs (see here). They would have to be percent encoded to be standards compliant. My main point, though, is serving the unencoded characters for the sole purpose of having nice-looking URLs, so percent enc...

going to new site when button click c#

how can i do that when my button clicked i will open a new internet window e.g walla.com? ...

Inserting variable into routes - map.resources :posts, :as => X - is this possible?

Ok, so I am working on a blog application of sorts. Thus far, it allows for a user to sign up for their own account, create posts, tags, comments, etc. I have just implemented the ability to use www.myapp.com/brandon to set @user to find by username and therefore correctly display the users information at each url. So when you go to ww...

UrlEncoding-Safe Delimiter

So the site I'm working on has a filter system that operates by passing a key and value system through a querystring. The whole site is going through a re-factor soon and I'm maintaining the existing site so before we discuss the RIGHT way to implement this, I just need ideas for changing my delimiter. The current format is like this: ...

Simple rails routing / url question

I'm using Ryan Bates' nifty authentication in my application for user signup and login. Each user has_many :widgets, but I'd like to allow users to browse other users' widgets. I'm thinking that a url scheme like /username/widgets/widget_id would make a lot of sense--it would keep all widget-related code in the same place (the widgets ...

URL mapping in Servlets

I am building a site with JSPs and Servlets. How do I map a URL like this example.com/12345 so that I get the response as if the request was example.com/content.jsp?id=12345? ...

.htaccess help: changing /register.php into /register

I have no idea about anything to do with .htaccess, apart from the basics of what it's used for. In this case I need it to rewrite URLs. I have a set of pages: index.php register.php login.php donate.php And I wanted to change them into URL's like this: http://localhost/ http://localhost/register http://localhost/login http://localh...

Finding part of a string that a user has sent via POST

My users can send links from popular file hosts like Rapidshare, Megaupload, Hotfile and FileFactory. I need to somehow find out what filehost they sent the link from and use the correct class for it appropriately. For example, if I sent a Rapidshare link in a form on my web page, I need to somehow cycle through each file host that I al...

Need to have either example.com/username or username.example.com, but how?

Hey guys, I'm almost finished developing my large project, however I would love it if I could make it so instead of having the users profile pages at: http://example.com/profile/username/USERNAME (i'm currently using .htaccess to rewrite the GET data into forward slashes and profile(.php) being read as just 'profile' profile.php also ...

Mapping Absolute / Relative (Local) Paths to Absolute URLs

I need a fast and reliable way to map an absolute or relative local path (say ./images/Mafalda.jpg) to it's corresponding absolute URL, so far I've managed to come up with this: function Path($path) { if (file_exists($path) === true) { return rtrim(str_replace('\\', '/', realpath($path)), '/') . (is_dir($path) ? '/' : ''...

Images not displaying if using file:///c:/

I am using jQuery and would like to display the images from my PC, rather than hosting them. I have the following: /* works fine: */ .ui-widget-header .ui-icon { background-image: url(images/ui-icons_2e83ff_256x240.png); } /* does not work: */ .ui-widget-header .ui-icon { background-image: url(file:///C:/ui-icons_2e83ff_256x240.pn...

Destroy and Show have same url in RoR, is it good?

Hi! Is it good when url to show and destroy are same? How it can be changed in RoR if i want continue use standard tools like script/generate scaffold ? Thanks. ...

PHP Form POST to external URL with Redirect to another URL

So, what I am trying to accomplish is have a self-posting PHP form, POST to an external page (using CURL) which in turn redirects to another page. Currently, what is happening is that once I click "Submit" on the form (in contact.php) it will POST to itself (as it is a self-posting form). The script then prepares the POST using CURL an...

Changing a url depending on what link chosen (HTML) no asp.

TLDR I need to change a javascript variable on the same page after clicking a link (can be from a different page) so that the getjson request pulls different data without having to duplicate on html pages. I am using some getJSON requests with Jquery, to make calls to populate my pages. I want to be able to (in plain HTML / javascript...

what does the search engine prefer now Dash or Underscore in a url

hi, what does the search engine prefer now Dash or Underscore in a url. http://website.com/dash-underscore http://website.com/dash_underscore thanks ...

URL Redirection

How do I set it up so that when someone goes to www.example.com/file1.mp3, they get redirected to www.example.com/file2.mp3, but the address in the browser bar stays the same? ...

Yii framework: Controller/Action url & parameters

In my application I have "ApiController" with "actionUsers", so in Yii the path becomes api/users. Now in order to get certain users info I use the following path api/users/id/10 where 10 is the userID and id part of the path is basically a GET parameter (api/users?id=10). Is there any way to do the same thing without id part of the pat...

Help with iphone dev - beyond bounds error

I'm just learning iphone development, so please forgive me for what is probably a beginner error. I've searched around and haven't found anything specific to my problem, so hopefully it is an easy fix. The book has examples of building a table from data hard coded via an array. Unfortunately it never really tells you how to get data fro...

Detecting a url using preg_match? without http:// in the string

Hey there, I was wondering how I could check a string broken into an array against a preg_match to see if it started with www. I already have one that check for http://www. function isValidURL($url) { return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url); } $stringToArray = explode(" ",$_POST['text']); ...