namespace WebApplication4
{
public partial class _Default : System.Web.UI.Page
{
public static bool UrlIsValid(string url)
{
bool br = false;
try
{
IPHostEntry ipHost = Dns.Resolve(url);
br = true;
}
catch (SocketException)
{
br = false;...
I have to secure a section of my GWT based application from accessing it directly via some url.
Actually there is an index page which is login page. The use gives credentials and enters into the app (the module to be saved).
Currently what I am doing is that when a user logs in I save his username into session ( session.setAttribute(“u...
any c/c++ library out there that provides functions like getUrl, urlopen, post etc. ?
...
I am looking for help in creating a Regular Expression that validates a URL of very long length (eg. a very long Google Maps address). I am new to regular expressions and I am using it in PHP with preg_match().
I have used the expression:
preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/...
This function is great, but its main flaw is that it doesn't handle domains ending with .co.uk or .com.au. How can it be modified to handle this?
function parseUrl($url) {
$r = "^(?:(?P<scheme>\w+)://)?";
$r .= "(?:(?P<login>\w+):(?P<pass>\w+)@)?";
$r .= "(?P<host>(?:(?P<subdomain>[-\w\.]+)\.)?" . "(?P<domain>[-\w]+\.(?P<ex...
hey guys,
i know top.location.search retruns ?key=anything&blabla=foobar of my current url. I wonder how i can get the search value out of any url?
if I have e.g.
$goToURL = 'http://www.anydomain.com/hello/?path=xyz
how can i get ?path=xyz out there and save it to a variable?
regards matt
...
I'm in the midst of moving a site from "plain old" php to the CakePHP framework and I need to be able to handle some legacy URLs, for example:
foo.com/bar.php?id=21
is the pattern of the current URLs, but in the new site using cake, that URL needs to redirect to:
foo.com/blah/21
So basically, I need to be able to grab that ID numbe...
Is there some way I can search in the profiles of users on Twitter?
e.g. User A has mentioned that he is "security, hacking geek" and his website is http://hackme.com
Now i want to search in 2 ways:
Search for "security" or "hacking" in user profiles and all users including A who have the word security in their profiles will be retur...
Hi,
I am getting following exception while running BIRT from a Linux OS.
Caused by: org.eclipse.datatools.connectivity.oda.OdaException: no protocol: /home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml
where "/home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml" is my XML data file.
When i looked into the code of...
How can get in ASP.NET user name and password from URL?
https://myUser:myPassword@myServer/
HttpContext.Current.Request.Url is returning https://myServer/.
...
I've got a website where URLs are rewritten in this format:
http://www.example.co.uk/module/page/query/
http://www.example.co.uk/index.php?m=module&p=page&q=query
Which gives rise to pages such as:
http://www.example.co.uk/schools/view/495/
http://www.example.co.uk/schools/search/park+lane/
Is there any way to make it so th...
How to automatically replace url in browser address bar with JavaScript
from company.com/en/services/
to company.com/en/#services
?
Example: when I type in browser address bar url company.com/en/services/ and click 'Go', it will be automatically seen company.com/en/#services
Is there any way to replace real url /services/ with h...
Usually when I get the url of a request i use Request.RawUrl.
This gives /default.aspx for example.
However recently my host changed something and now the name of the application directory is displayed as well so i get /appdirname/default.aspx.
Now why does it give me the directory of the application? It looks as if my website is a su...
Hello,
I'm trying to generate UUIDs with the same style as bit.ly urls like:
http://bit.ly/aUekJP
or cloudapp ones:
http://cl.ly/1hVU
which are even smaller
how can I do it?
I'm now using UUID gem for ruby but I'm not sure if it's possible to limitate the length and get something like this.
I am currently using this:
UUID.generat...
I need to get the URL search paramentes in an object, for eg; http://example.com/?a=x&b=y&d#pqr should yield {a:x, b:y, d:1}
Below is the method i used to get this, How can i improve this? any suggessions...
var urlParamKeyVals = new Array();
var pieces = new Array();
var UrlParams = {};
...
On the Microformats spec for RESTful URLs:
GET /people/1
return the first record in HTML format
GET /people/1.html
return the first record in HTML format
and /people returns a list of people
So is /people.html the correct way to return a list of people in HTML format?
...
Hi. I have a code like this that extract the country code saved in the cookie.
if (isset($_COOKIE['country']))
{
$country = $_COOKIE['country'];
$language = "eng";
if ($country == "NO"){
$language = "nor";
} ...
How do you encode an url in Android? I thought it was like this:
final String encodedURL = URLEncoder.encode(urlAsString, "UTF-8");
URL url = new URL(encodedURL);
If I do the above, the http:// in urlAsString is replaced by http%3A%2F%2F in encodedURL and then I get a java.net.MalformedURLException when I use the url.
Thanks!
...
I think this should be elementary, but I still cant't get my head around it.
Let's say there's fair amount of HTML documents and I need to catch every image urls out of them.
The rest of the content changes, but the base of the url is always the same for example http://images.examplesite.com/images/,
so I wan't to extract every string t...
I'm starting a new site project in Codeigniter. I need this site to be multilingual, where English will be the default language.
I know how the language class in codeigniter works, and I am already using it.
My concern is that I need the URL to be shown in the selected language. I'll explain myself with an example:
When English langu...