Search Results

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

Page 160/854 | < Previous Page | 156 157 158 159 160 161 162 163 164 165 166 167  | Next Page >

  • show template in joomla (parameter)

    - by hsmit
    I know it is possible in Joomla! to set the template temporarily to another template with an URL parameter. Does anyone remember the parameter? And how should the template be indicated? I expect something like index.php?template=mytemplate

    Read the article

  • How to give user message and choice before ActionLink

    - by RememberME
    I have the following link. On click, I'd like to check the item.primary_company field and if populated, give the user a warning and ask if they would like to continue. How can I do this? <a href="<%= Url.Action("Activate", new {id = item.company_id}) %>" class="fg=button fg-button-icon-solo ui-state-default ui-corner-all"><span class="ui-icon ui-icon-refresh"></span></a>

    Read the article

  • Lauching Lotus Notes with mailto:

    - by SKR
    I have a mailto url in a web page. The target system contains both Microsoft Outlook and Lotus Notes. Microsoft Outlook is the **default** Mail Client. So when i click on *mailto* link it opens up Microsoft Outlook. I want it to open Lotus Notes when i click on the link and i do **NOT** want change the default mail client settings in Internet Options as well. Please suggest a solution or work around to achive this.

    Read the article

  • Best methods to make urls friendly?

    - by Geuis
    We're working on revising the url structure for some of our movie content, but we aren't quite sure on the best way to handle odd characters. For example, '303/302' '8 1/2 Women' 'Dude, Where's My Car?' '9-1/2 Weeks' So far, we're thinking: /movies/303-302 /movies/8-1-2-women /movies/dude-wheres-my-car /movies/9-1-2-weeks Is this the best solution? Is there anything we're forgetting?

    Read the article

  • What rendering services are available to convert URLs to images?

    - by tangens
    I know some services that encode the description of an image inside on an URL. For example: yuml.me for drawing UML Diagrams: or www.codecogs.com for rendering LaTeX equations: I really like these services to use them inside my javadoc to illustrate the documentation. On stackoverflow.com it's a bit tricky to encode these URLs, see my request at meta.stackoverflow.com. Question Are there any other rendering services that are useful for documenting source code?

    Read the article

  • ReWrite Rules Issue

    - by Jacob Clark
    I seem to be having an issue with my Apache Rewrites RewriteEngine on RewriteBase / RewriteRule ^wordpress/?$ / [NC,L,R=301] RewriteRule ^/$ wordpress/ [NC,L] I simply need to remove /wordpress from the URL as I have pages within Wordpress I want to be seen as the main directory At the moment the urls are domain.com/wordpress/blog I'd rather not have /wordpress, rather domain.com/blog Any help?

    Read the article

  • Easy way to open the Mail application with an pre-defined message subject and body?

    - by mystify
    In my app the user generates text content. I want to enable the user to launch the Mail application, which then should contain a specified subject and message body. Like: You write a poem in my app and then want to send it to your new girlfriend. So you tap a mail icon and the Mail app opens, containing already an subject and message body with your poem inside. Someone said there is a kind of URL mechanism for that?

    Read the article

  • extract all urls from a string

    - by codemonkey12
    I have a string of text that contains html, and I need to extract each url (most likely in img or a tags) to create a generic list of string objects. Is there an easy way to do this or will I have to resort to regular expressions? If I have to resort to regular expressions, would you mind helping me out with that as well? :)

    Read the article

  • IIRF with IIS and the ASP.Net Tilda(~)

    - by Justin808
    Hello, When I turn on URL Rewriting to access a page, the ~ no long is replaced with the application root. For example should produce: but its only outputting The tilda is supposed to be replaced with the application root path but it looks like IIRF is messing with that somehow? Any ideas on how to fix this?

    Read the article

  • How to use ';' in urls, using Google Appengine

    - by tonfa
    Using the local dev server, I can use ';' in urls, but as soon as I try the live version hosted by Google, it looks like the ';' and everything afterward is stripped (at least according to request.path_qs). (I would prefer not to encode them if possible, it's much less user friendly if the url cannot be constructed by copy-pasting, especially since other characters works fine, e.g. ':').

    Read the article

  • Base64url and Base64 facebook

    - by Shekhar_Pro
    I have actually 2 questions: 1)What is the difference between base64url encoding and base64 encoding and 2)How base64url encode is different from Facebooks base64url encode because facebook mentions that it sends url in a form of base64url but with no padding and two different characters. http://developers.facebook.com/docs/authentication/canvas (under Why Sign calls) Can anyone plese provide a pseudocode with explaination for converting to and from each other.

    Read the article

  • Custom route does not work in ASP.net MVC 3

    - by user603007
    I am trying to implement my custom route in ASP.net MVC 3 but I get this error: The resource cannot be found. global.asax public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "mycontroller", // Route name "{controller}/{name}", // URL with parameters new { controller = "MyController", action = "Search" } // Parameter defaults ); } MyController.cs public class MyController : Controller { public ActionResult Search(string name) { return Content(name); } }

    Read the article

  • Using .htaccess to change my website URLs

    - by James P
    I have some pages organised like this: http://localhost/index.html http://localhost/download.html http://localhost/contact.html And I need them changed to suit the following URL structure: http://localhost/ http://localhost/download http://localhost/contact Without making sub directories and putting in pages as index.html. As far as I know .htaccess can be used for this, but I have no idea what I need to add to my .htaccess file to make this work. Can anyone provide some help? Thanks.

    Read the article

  • Obtaining standard port for arbitrary protocols in PHP

    - by Trott
    I'm looking for a function that will accept a string representing the scheme portion of a URL (e.g., "http", "https", "ftp", etc.) and return the standard port. It might be used like this: echo get_port_from_protocol("http"); // 80 As a last resort, I suppose I could write something to parse through /etc/services (assuming I only need to run under UNIX-like operating systems). But surely there must be something built-in to PHP, no?

    Read the article

  • mod_rewrite if file exists

    - by Mathieu Parent
    Hi everyone, I already have two rewrite rules that work correctly for now but some more code has to be added to work perfectly. I have a website hosted at mydomain.com and all subdom.mydomain.com are rewrited to mydomain.com/subs/subdom . My CMS has to handle the request if the file being reached does not exist, the rewrite is done like so: RewriteCond $1 !^subs/ RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ subs/%1/index.php?page=$1 [L] My CMS handles the next part of the parsing as usual. The problem is if a file really exists, I need to link to it without passing through my CMS, I managed to do it like this: RewriteCond $1 !^subs/ RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com$ RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ subs/%1/$1 [L] So far it seems to work like a charm. Now I am being picky and I need to have default files that are stored in subs/default/. If the file exists in the subdomain folder, we should grab this one but if not, we need to get the file from the default subdomain. And if the file does not exist anywhere, we should be using the 404 page from the current subdomain unless there is none. I hope it describes well enough. Thank you for your time!

    Read the article

  • Submitting a URL into a Form without "http://", with "www.", or with neither

    - by John
    (EDITED) Hello, In the form below, the filed for <div class="urlfield"><input name="url" type="url" id="url" maxlength="500"></div> fine when a URL is submitted that has a "http://" at the beginning of it. However, it doesn't work if a URL is submitted with only a "www." in front of it, or with neither a "http://" nor a "www." How can I make it work in all if the submitted URL has any or none of the following at the beginning of it: http:// www. http://www. Thanks in advance, John Form: echo '<div class="submittitle">Submit an item.</div>'; echo '<form action="http://www...com/.../submit2.php" method="post"> <input type="hidden" value="'.$_SESSION['loginid'].'" name="uid"> <div class="submissiontitle"><label for="title">Story Title:</label></div> <div class="submissionfield"><input name="title" type="title" id="title" maxlength="1000"></div> <div class="urltitle"><label for="url">Link:</label></div> <div class="urlfield"><input name="url" type="url" id="url" maxlength="500"></div> <div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div> </form> '; submit2.php: <?php if($_SERVER['REQUEST_METHOD'] == "POST"){header('Location: http://www...com/.../submit2.php');} require_once "header.php"; if (isLoggedIn() == true) { $remove_array = array('http://www.', 'http://', 'https://', 'https://www.', 'www.'); $cleanurl = str_replace($remove_array, "", $_POST['url']); $cleanurl = strtolower($cleanurl); $cleanurl = preg_replace('/\/$/','',$cleanurl); $cleanurl = stripslashes($cleanurl); $title = $_POST['title']; $uid = $_POST['uid']; $title = mysql_real_escape_string($title); $title = stripslashes($title); $cleanurl = mysql_real_escape_string($cleanurl); $site1 = 'http://' . $cleanurl; $displayurl = parse_url($site1, PHP_URL_HOST); function isURL($url1 = NULL) { if($url1==NULL) return false; $protocol = '(http://|https://)'; $allowed = '[-a-z0-9]{1,63}'; $regex = "^". $protocol . // must include the protocol '(' . $allowed . '\.)'. // 1 or several sub domains with a max of 63 chars '[a-z]' . '{2,6}'; // followed by a TLD if(eregi($regex, $url1)==true) return true; else return false; } if(isURL($site1)==true) mysql_query("INSERT INTO submission VALUES (NULL, '$uid', '$title', '$cleanurl', '$displayurl', NULL)"); else echo "<p class=\"topicu\">Not a valid URL.</p>\n"; } else { show_loginform(); } if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } require_once "footer.php"; ?>

    Read the article

  • Help parsing long (3.5mil lines) text file, line by line and storing data, need a strategy

    - by Jarrod
    This is a question about solving a particular problem I am struggling with, I am parsing a long list of text data, line by line for a business app in PHP (cron script on the CLI). The file follows the format: HD: Some text here {text here too} DC: A description here DC: the description continues here DC: and it ends here. DT: 2012-08-01 HD: Next header here {supplemental text} ... this repeats over and over for a few hundred megs I have to read each line, parse out the HD: line and grab the text on this line. I then compare this text against data stored in a database. When a match is found, I want to then record the following DC: lines that succeed the matched HD:. Pseudo code: while ( the_file_pointer_isnt_end_of_file) { line = getCurrentLineFromFile title = parseTitleFrom(line) matched = searchForMatchInDB(line) if ( matched ) { recordTheDCLines // <- Best way to do this? } } My problem is that because I am reading line by line, what is the best way to trigger the script to start saving DC lines, and then when they are finished save them to the database? I have a vague idea, but have yet to properly implement it. I would love to hear the communities ideas\suggestions! Thank you.

    Read the article

  • NSXMLParser not parsing attributes. No NSXMLParser Error.

    - by Iris
    I am trying to parse the XML located at this URL: http://www.iglooseat.com/gis_iphone_xml.php?zip=06488 // 1) This method gets invoked when the user presses a button on the Iphone to retrieve the xml data (IBAction)getLocations:(id)sender { NSString *msg=nil; NSString *urlString= [[NSString alloc] initWithFormat:@"http://www.iglooseat.com/gis_iphone_xml.php?zip=%@",zipField.text]; // send the URL NSError *error; [siteList updateLocationsFromURL:urlString parseError:&error]; WPSite *w = [siteList siteAtIndex:0]; // alert user what's in the zipField msg = [[NSString alloc] initWithFormat: @"url to send: %@\n site name: %@" , urlString , w.name]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Debug" message:msg delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [urlString release]; [alert show]; [alert release]; [msg release]; } // 2) This function takes the URL and performs XML parsing on the data at that URL. (void)updateLocationsFromURL:(NSString )urlString parseError:(NSError *)error{ /* NSURL class that inherits from NSObject class that provides a way to manipulate URLs and the resources they reference. */ NSURL *url = [[NSURL alloc] initWithString:urlString]; /* initWithContentsOfURL: initializes a newly allocated data object initialized with the data from the location specified by a URL. */ NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; // init bool to NO errorConnecting = NO; // release from mem the NSURfile://localhost/Users/icheung/Desktop/WPMap/Classes/WPSite.mL [url release]; // set parser delgate to self [parser setDelegate:self]; // don't process namespace [parser setShouldProcessNamespaces:YES]; // or namespace prefixes [parser setShouldReportNamespacePrefixes:NO]; /* don't care 'bout external (ex. don't perform I/O op's to load external DTD's (Document Type Definitions)) */ [parser setShouldResolveExternalEntities:NO]; // start the event-driven parsing operation [parser parse]; // get NSError object if an error occured during parsing NSError *parseError = [parser parserError]; if(parseError && error) { *error = parseError; NSLog(@"Error code:%d %@", parseError.code, parseError.domain); errorConnecting = YES; } // relase from mem the parser [parser release]; } // 3) In the parser:didStartElement:namespaceURI:qualifiedName:attributes: I attempt to extract the 'state' attribute from a 'marker' element in my xml. When I use the gdb debugger to inspect the contents of attributeDict it is empty and I'm not sure why. (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { if(self.parserContentOfCurrentProperty == nil) { NSMutableString *tmp = [[NSMutableString alloc] init]; self.parserContentOfCurrentProperty = tmp; [tmp release]; } [self.parserContentOfCurrentProperty setString:@""]; self.parserNameOfCurrentProperty = elementName; if ([elementName isEqualToString:@"markers"]) { WPSite *tmp = [WPSite alloc]; self.parserCurrentSite = tmp; // retrive value for attribute NSString *stateAttribute = [attributeDict valueForKey:@"state"]; if (stateAttribute) { [self.parserCurrentSite setState:stateAttribute]; } // add this site to the site list [siteList addObject:self.parserCurrentSite]; return; } }

    Read the article

  • when get pagecontent from URL the connect alway return nopermistion ?

    - by tiendv
    I have a methor to return pagecontent of link but when it run, alway return "Do not perrmisson ", plesea check it here is code to return string pagecontent public static String getPageContent(String targetURL) throws Exception { Hashtable contentHash = new Hashtable(); URL url; URLConnection conn; // The data streams used to read from and write to the URL connection. DataOutputStream out; DataInputStream in; // String returned as the result . String returnString = ""; // Create the URL object and make a connection to it. url = new URL(targetURL); conn = url.openConnection(); // check out permission of acess URL if (conn.getPermission() != null) { returnString = "Do not Permission access URL "; } else { // Set connection parameters. We need to perform input and output, // so set both as true. conn.setDoInput(true); conn.setDoOutput(true); // Disable use of caches. conn.setUseCaches(false); // Set the content type we are POSTing. We impersonate it as // encoded form data conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); // get the output stream . out = new DataOutputStream(conn.getOutputStream()); String content = ""; // Create a single String value pairs for all the keys // in the Hashtable passed to us. Enumeration e = contentHash.keys(); boolean first = true; while (e.hasMoreElements()) { // For each key and value pair in the hashtable Object key = e.nextElement(); Object value = contentHash.get(key); // If this is not the first key-value pair in the hashtable, // concantenate an "&" sign to the constructed String if (!first) content += "&"; // append to a single string. Encode the value portion content += (String) key + "=" + URLEncoder.encode((String) value); first = false; } // Write out the bytes of the content string to the stream. out.writeBytes(content); out.flush(); out.close(); // check if can't read from URL // Read input from the input stream. in = new DataInputStream(conn.getInputStream()); String str; while (null != ((str = in.readLine()))) { returnString += str + "\n"; } in.close(); } // return the string that was read. return returnString; }

    Read the article

  • Creating meaningful add URLs in Cakephp

    - by Loftx
    Hi there, For my site I have a number of Orders each of which contains a number of Quotes. A quote is always tied to an individual order, so in the quotes controller I add a quote with reference to it's order: function add($orderId) { // funtion here } And the calling URL looks a bit like http://www.example.com/quotes/add/1 It occurred to me the URLs would make more sense if they looked a bit more like http://www.example.com/orders/1/quotes/add As the quote is being added to order 1. Is this something it's possible to achive in CakePHP? Cheers, Tom

    Read the article

  • Call named routes in CakePHP as the same way in Ruby on Rails

    - by Lucas Renan
    How can I call a route (in the view) in CakePHP as the same way in Rails? Ruby on Rails routes.rb map.my_route '/my-route', :controller => 'my_controller', :action => 'index' view link_to 'My Route Name', my_route_path CakePHP routes.php Router::connect('/my-route', array('controller' => 'my_controller', 'action' => 'index')); view $html->link('My Route Name', '/my-route'); But I think the Rails way is better, because I can make changes in the "url" and I don't need changes the code of the views.

    Read the article

< Previous Page | 156 157 158 159 160 161 162 163 164 165 166 167  | Next Page >