url

jquery - get url path?

I know I can use window.location.pathname to return a url, but how do I parse the url? I have a url like this: http://localhost/messages/mine/9889 and I'm trying to check to see if "mine" exists in that url? So, if "mine" is the second piece in that url, I want to write an if statement based on that... if(second argument == 'mine')...

[PHP] Sanitizing strings to make them URL and filename safe?

I am trying to come up with a function that does a good job of sanitizing certain strings so that they are safe to use in the URL (like a post slug) and also safe to use as file names. For example, when someone uploads a file I want to make sure that I remove all dangerous characters from the name. So far I have come up with the followi...

.htaccess code to protect a single url?

Is it possible to achieve this? For example I will have "website.com/index.php?skin=name" can I password protect only this url? (with no php changing only htaccess) P.S. "website.com/index.php" or "website.com/index.php?skin=other_name" should not be restricted.. Thanks! ...

Get url from iframe and update hash in browser url

I've tried a few different things but nothing really worked, basically i need to get the current location/url from the iframe, get the part i want and return it to the hash in the url. how can i do this in javascript? ...

URL Generation Technique with PHP

I have a build a web portal based on the Cricket concept, I have build a Custom based CMS where I can upload the News for the site Once I upload the news, the URL Will be like this http://cricandcric.com/news/news.php?id=841&An-emotional-moment:-Dhoni.html But I am trying to have the above Url as follows (some thing like this) ht...

What is the best URL strategy to handle multiple search parameters and operators?

Searching with mutltiple Parameters In my app I would like to allow the user to do complex searches based on several parameters, using a simple syntax similar to the GMail functionality when a user can search for "in:inbox is:unread" etc. However, GMail does a POST with this information and I would like the form to be a GET so that the...

Regex for Searching for Text Not Preceded By a Specific String

Hi, I am working on a web site with several other developers and we have had problems where people commit JavaScript code with AJAX calls that use URL's relative to the site root. An example would be /Home/Index which will not work if the site is hosted in a virtual directory. To get round the problem we use a $.url() method to convert...

Looking for a java web framework that support django styled url handling

I'm looking for a java web framework that will allow you to configure dynamic urls where information is being passed to the controller. For example /{clientName}/login would call the same controller regardless of the clientName and pass that clientName as an accessible value or an object in it's own right. ...

URL Rewrite problem. (Many directory)

Hello! I'd like to make a htaccess file, which can make a good structure for my websites. My .htaccess is now: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$ RewriteCond %{REQUEST_URI} !/admin RewriteRule ^(.*)$ index.php?q=$1 [QSA] (based on Sombat's comment, and about 30 try :P) And I want t...

java.net.UnknownHostException on file:// method

failed to open file file://D/:/dev/test_all.html JavaException: java.net.UnknownHostException: D Any ideas for why this happens? ...

how wordpress can un-slug a title

i still , don't understand , how wordpress can understand what is this url refer to : www.mysite.com/about-me/ they are using no identifier if they using slug functions so how they can retain story information or in other word , how they change back the slugged title to select from database ...

MOSS Filter webpart not working with & symbol in the query string

Hi, I know this is a fairly common error with URL encoding. The problem I suspect is the MOSS Filter webpart used to filter a dataview webparts results based on the querystring paramter passed to it from the Filter webpart. When the query string contains an & (ampersand) symbol the dataview webpart is unable to display any results but ...

Passing a URL as a URL parameter

I am implementing OpenId login in a CakePHP application. At a certain point, I need to redirect to another action, while preserving the information about the OpenId identity, which is itself a URL (with GET parameters), for instance https://www.google.com/accounts/o8/id?id=31g2iy321i3y1idh43q7tyYgdsjhd863Es How do I pass this d...

Bookmarklet to edit current URL.

Hi, I'm looking for a simple bookmarklet to take the current URL of my website and refresh it with a couple of changes. For example: Take the current page: http://www.example.com/pages/ and change it to: https: //admin.example.com/pages/ * then load that new URL. *(I added an extra space after https:// because I'm a new user so can't...

Dealing with multiple parameters in Nginx rewrite

I have a rewrite that nginx calls like so: location ~* (css)$ { rewrite ^(.*),(.*)$ /min/index.php?f=$1,/min/$2 last; } And it's used on pages like this: http://domain.com/min/framework.css,dropdown.css Works all fine and dandy, but it's not scalable. Adding another element to the URL means I have to directly edit t...

how can I determine the path of a site using php/smarty?

Ok, say I have a page with the url: URL.com/checkout/completed, how can I setup an if statemet to perform: <if "This page has url of checkout/completed"> No Content <else> Content </if> Is there a way? A simple way, my php/smarty-fu lacks.. A lot. EDIT: {if $smarty.server.REDIRECT_URL eq 'http://www.euroworker.no/checkout/comple...

html/php: how to handle absolute url's?

Is the html <base> tag safe to use in terms of browser support? Or should I generate a root path with PHP which i then add like this <a href="<?=BASE?>somepage.html">somepage</a> which makes up a absolute url. using the base tag like this <base href="<?=BASE?>" /> I am then able to use links like this <a href="somepage.html">somepage<...

Regex: Getting content from URL

I want to get "the-game" using regex from URLs like http://www.somesite.com.domain.webdev.domain.com/en/the-game/another-one/another-one/another-one/ http://www.somesite.com.domain.webdev.domain.com/en/the-game/another-one/another-one/ http://www.somesite.com.domain.webdev.domain.com/en/the-game/another-one/ ...

jQuery Flow Control (if then from URL params)

Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an ex...

php URI troube with if statement,

I am running an if statement, that looks like this, if($this->uri->segment(1) !== 'search' || $this->uri->segment(1) !== 'employment') { //dome something } My problem is that first condition works, if the uri segment 1 equals search then the method do not run however if I on the page employment, and the first segment of the uri i...