Search Results

Search found 19174 results on 767 pages for 'restful url'.

Page 33/767 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Sending URL as a parameter using javascript

    - by Prashant Singh
    I have to send a name and a link from client side to the server. I thought of using AJAX called by Javascript to do this. This is what I mean. I wished to make an ajax request to a file called abc.php with parameters :- 1. http://thumbs2.ebaystatic.com/m/m7dFgOtLUUUSpktHRspjhXw/140.jpg 2. Apple iPod touch, 3rd generation, 32GB To begin with, I encoded the URL and tried to send it. But the server says status Forbidden Any solution to this ? UPDATE :: It end up calling to http://abc.com/addToWishlist.php?rand=506075547542422&image=http://thumbs1.ebaystatic.com/m/mO64jQrMqam2jde9aKiXC9A/140.jpg&prod=Flat%20USB%20Data%20Sync%20Charging%20Charger%20Cable%20Apple%20iPhone%204G%204S%20iPod%20Touch%20Nano Javascript Code :: function addToWishlist(num) { var myurl = "addToWishlist.php"; var myurl1 = myurl; myRand = parseInt(Math.random()*999999999999999); var rand = "?rand="+myRand ; var modurl = myurl1+ rand + "&image=" + encodeURI(storeArray[num][1]) + "&prod=" + encodeURI(storeArray[num][0]); httpq2.open("GET", modurl, true); httpq2.onreadystatechange = useHttpResponseq2; httpq2.send(null); } function useHttpResponseq2() { if (httpq2.readyState == 4) { if(httpq2.status == 200) { var mytext = httpq2.responseText; document.getElementById('wish' + num).innerHTML = "Added to your wishlist."; } } } Server Code <?php include('/home/ankit/public_html/connect_db.php'); $image = $_GET['image']; $prod = $_GET['prod']; $id = $_GET['id']; echo $prod; echo $image; ?> As I mentioned, its pretty basics More Updates : On trying to send a POST request via AJAX to the server, it says :- Refused to set unsafe header "Content-length" Refused to set unsafe header "Connection"

    Read the article

  • Test if string is URL encoded in PHP

    - by Psytronic
    Hey guys, I've looked through the PHP Docs and can't see anything to do with this, so how can I test if a string is URL encoded? Is it better to search the string for characters which would be encoded, which aren't, and if any exist then its not encoded, or use something like this which I've made function is_urlEncoded($string){ $test_string = $string; while(urldecode($test_string) != $test_string){ $test_string = urldecode($test_string); } return (urlencode($test_string) == $string)?True:False; } $t = "Hello World how are you?"; if(is_urlEncoded($sreq)){ print "Was Encoded.\n"; }else{ print "Not Encoded.\n"; print "Should be ".urlencode($sreq)."\n"; } Which works, however not in instances where this might occur $t = "Hello%2BWorld%2B%253E%2Bhow%2Bare%2Byou%253F"; I.e. where the string has been doubly encoded, or maybe this string $t = "Hello+World%2B%253E%2Bhow%2Bare%2Byou%253F"; I.e. where most has been doubly encoded, except for one space. (Yes I don't know when this string would ever occur, but you never know)

    Read the article

  • IIS URL Rewrite rule - Default document for subdirectories

    - by Antonio Bakula
    I would like create URL rewrite rule that will set default document for my virtual folders. eg. someting like this www.domain.com/en/ -> www.domain.com/en/index.aspx www.domain.com/hr/ -> www.domain.com/hr/index.aspx www.domain.com/de/ -> www.domain.com/de/index.aspx directories en, hr, de doesn't really exists on web server they are just markers for languange used in site used by home grown http module that will rewrite path with query params. Quick solution was define rule for every single lang, something like this : <rewrite> <rewriteMaps> <rewriteMap name="Langs"> <add key="/en" value="/en/index.aspx" /> <add key="/hr" value="/hr/index.aspx" /> <add key="/de" value="/de/index.aspx" /> </rewriteMap> </rewriteMaps> <rules> But I would really like solution that would not require changes in web.config and adding rewrite rule for every languange used on particular site. Thanks !

    Read the article

  • How to turn dynamic URL into static URL

    - by Rafael Carvalho
    I am developing a website using PHP and Apache. I wanna turn my URLs from www.example.com/book.php?book=title into something like this, if it is possible of course: www.example.com/book/title Notice that the title of the books are unique and cannot be repeated. I`ve read about this, but none of the posts were clear enough for a beginner like me. Do you guys know any tutorial that explains that? Thanks.

    Read the article

  • Rewrite URL to index.php but avoid index.php in the URL

    - by Tom
    I'm trying to internally redirect all requests to index.php and externally redirect all requests that contain index.php using a .htaccess file. So URLs like http://host/test should be processed by index.php and URLs like http://host/index.php/test should be redirected to http://host/test and then processed by index.php (without redirecting the browser to index.php) I tried the following but always get a message "Too many redirects...": RewriteRule ^index\.php/?(.*)$ /$1 [R,L] RewriteRule .* index.php/$0 [L]

    Read the article

  • Google App engine Url Mapping using WSGIAppl and regx grouping Help Needed

    - by spidee
    Hi take this example from google docs class BrowseHandler(webapp.RequestHandler): > def get(self, category, product_id): > # Display product with given ID in the given category. > > > # Map URLs like /browse/(category)/(product_id) to > BrowseHandler. application = > webapp.WSGIApplication([(r'/browse/(.*)/(.*)', > BrowseHandler) > ], > debug=True) > > def main(): > run_wsgi_app(application) > > if __name__ == '__main__': > main() How can i change the regx groupings so that Product id is optional ie the url http://yourdomain.com/category will be sent to the browse handler in the current above example you must add a product id or at least the / after the category ie http://yourdomain.com/category/ r'/browse/(.)/(.)' Any ideas?

    Read the article

  • CodeIgniter: Passing variables via URL - alternatives to using GET

    - by John Durrant
    I'm new to CodeIgniter and have just discovered the difficulties using the GET method of passing variables via the URL (e.g. domain.com/page.php?var1=1&var2=2). I gather that one approach is to pass the variables in the URI segments but haven't quite figured out how to do that yet as it seems to create the expectation of having a function in the controller named as the specific URI segment???? Anyway Instead of using GET I've decided to use POST by adapting a submit button (disguised as a link) with the variables in hidden input fields. I've created the following solution which seems to work fine, but am wondering whether I'm on the right track here or whether there is an easier way of passing variables via a link within CodeIgniter? I've created the following class in application/libraries/ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class C_variables { function variables_via_link($action, $link_text, $style, $link_data) { $attributes = array('style' => 'margin:0; padding:0; display: inline;'); echo form_open($action, $attributes); $attributes = array('class' => $style, 'name' => 'link'); echo form_submit($attributes, $link_text); foreach ($link_data as $key => $value){ echo form_hidden($key, $value); } echo form_close(); } } ?> With the following CSS: /* SUBMIT BUTTON AS LINK adapted from thread: http://forums.digitalpoint.com/showthread.php?t=403667 Cross browser support (apparently). */ .submit_as_link { background: transparent; border-top: 0; border-right: 0; border-bottom: 1px solid #00F; border-left: 0; color: #00F; display: inline; margin: 0; padding: 0; cursor: hand /* Added to show hand when hovering */ } *:first-child+html .submit_as_link { /* hack needed for IE 7 */ border-bottom: 0; text-decoration: underline; } * html .submit_as_link { /* hack needed for IE 5/6 */ border-bottom: 0; text-decoration: underline; } Link then created using the following code in the VIEW: <?php $link = new C_variables; $link_data=array('var1' => 1, 'var2' => 2); $link ->variables_via_link('destination_page', 'here is a link!', 'submit_as_link', $link_data); ?> Thanks for your help...

    Read the article

  • Passing password value through URL

    - by Steven Wright
    OK I see a lot of people asking about passing other values, URLS, random stuff through a URL, but don't find anything about sending a password to a password field. Here is my situation: I have a ton of sites I use on a daily basis with my work and oh about 90% require logins. Obviously remembering 80 bajillion logins for each site is dumb, especially when there are more than one user name I use for each site. So to make life easier, I drew up a nifty JSP app that stores all of my logins in a DB table and creates a user interface for the specific page I want to visit. Each page has a button that sends a username, password into the id parameters of the html inputs. Problem: I can get the usernames and other info to show up just dandy, but when I try and send a password to a password field, it seems that nothing gets received by the page I'm trying to hit. Is there some ninja stuff I need to be doing here or is it just not easily possible? Basically this is what I do now: http://addresshere/support?loginname=steveoooo&loginpass=passwordhere and some of my html looks like this: <form name="userform" method="post" action="index.jsp" > <input type="hidden" name="submit_login" value="y"> <table width="100%"> <tr class="main"> <td width="100" nowrap>Username:</td> <td><input type="text" name="loginname" value="" size="30" maxlength="64"></td> </tr> <tr class="main"> <td>Password: </font></td> <td><input type="password" name="loginpass" value="" size="30" maxlength="64"></td> </tr> <tr class="main"> <td><center><input type="submit" name="submit" value="Login"></center></td> </tr> </table> </form> Any suggestions?

    Read the article

  • Resolving an App-Relative URL without a Page Object Reference

    - by Damon
    If you've worked with ASP.NET before then you've almost certainly seen an application-relative URL like ~/SomeFolder/SomePage.aspx.  The tilde at the beginning is a stand in for the application path, and it can easily be resolved using the Page object's ResolveUrl method: string url = Page.ResolveUrl("~/SomeFolder/SomePage.aspx"); There are times, however, when you don't have a page object available and you need to resolve an application relative URL.  Assuming you have an HttpContext object available, the following method will accomplish just that: public static string ResolveAppRelativeUrl(string url) {      return url.Replace("~", System.Web.HttpContext.Current.Request.ApplicationPath); } It just replaces the tilde with the application path, which is essentially all the ResolveUrl method does.

    Read the article

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

    - by Stefan
    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 parses the url correctly to retrieve the GET data) But it would be some much better if I could do it so that it's like http://www.example.com/USERNAME (preferred) or http://www.USERNAME.example.com Any ideas or resources? Thanks, Stefan

    Read the article

  • ASP.NET Routing not working when deployed under IIS,Works in IDE

    - by Shyju
    I have an ASP.NET web application developed in VS 2008 and i have implemented ASP.NET web forms URL routing by following this link http://www.4guysfromrolla.com/articles/051309-1.aspx#postadlink It works pretty good when i run it on the Visual studion IDE.But does not works when i created a site under my IIS and deployed the same files there.I have set ASP.NET version as 2.0 in the Properties window of my application too.But does not work. Any idea Why ? Is there anything else to be setup ? Thanks in advance

    Read the article

  • Challenges in multi-player Android Game Server with RESTful Nature

    - by Kush
    I'm working on an Android Game based on Contract Bridge, as a part of my college Summer Internship project. The game will be multi-player such that 4 Android devices can play it, so there's no BOT or CPU player to be developed. At the time of getting project, I realized that most of the students had already worked on the project but none of their works is reusable now (for variety of reasons like, undocumented code and design architecture, different platform implementation). I have experience working on several open source projects and hence I emphasis to work out on this project such that components I make become reusable as much as possible. Now, as the game is multi-player and entire game progress will be handled on server, I'm currently working on Server's design, since I wanted to make game server reusable such that any client platform can use it, I was previously confused in selecting Socket or REST for Game Server's design, but later finalized to work on REST APIs for the server. Now, since I have to keep all players in-sync while they make movements in game, on server I've planned to use Database which will keep all players' progress, specific for each table (in Bridge, 4 players play on single table, and server will handle many such game tables). I don't know if its an appropriate decision to use database as shared medium to track progress of each game table (let me know if there's an appropriate or better option). Obviously, when game is completed for the table, data for that table on server's database is discarded. Now the problem is that, access to REST service is an HTTP call, so as long as client doesn't make any request, server will remain idle, and consider a situation where A player has played a card on his device and the device requests to apply this change on the server. Now, I need to let rest of the three devices know that the player has played a card, and also update view on their device. AFAIK, REST cannot provide a sort-of Push-notification system, since the connection to the server is not persistent. One solution that I thought was to make each device constantly poll the server for any change (like every 56 ms) and when changes are found, reflect it on the device. But I feel this is not an elegant way, as every HTTP request is expensive. (and I choose REST to make game play experience robust since, a mobile device tends to get disconnected from Internet, and if there's Socket-like persistent connection then entire game progress is subject to lost. Also, portability on client-end is important) Also, imagining a situation where 10 game tables are in progress and 40 players are playing, a server must be capable to handle flooded HTTP requests from all the devices which make it every 56 ms. So I wonder if the situation is assumed as DoS attack. So, explaining the situation, am I going on the right track for the server design? I wanted to be sure before I proceed much further with the code.

    Read the article

  • Tellago Devlabs: A RESTful API for BizTalk Server Business Rules

    - by gsusx
    Tellago DevLabs keeps growing as the primary example of our commitment to open source! Today, we are very happy to announce the availability of the BizTalk Business Rules Data Service API which extends our existing BizTalk Data Services solution with an OData API for the BizTalk Server Business Rules engine. Tellago’s Vishal Mody led the implementation of this version of the API with some input from other members of our technical staff. The motivation The fundamental motivation behind the BRE Data...(read more)

    Read the article

  • Strategy for restoring state via URL in web apps

    - by JW01
    This is a question about modern web apps, where a single page is loaded, and all subsequent navigation is done by XHR calls and modifying the DOM. We can use libraries that manipulate the hash string, which let us navigate by URL and support the back/forward buttons. But to use those libraries, we need to be able to move the UI from any one state to any other. Is there a good strategy for moving between UI states, that also allows them to be restored from scratch when you load a new URL? In a complex app, you might have a lot of different states. You don't want to reload the entire UI each time you change states. But you also don't want to require separate methods for moving from every state to each every state. Typically we need to: Restore a state from scratch, when you enter a new URL or hit Reload. Move from one state to another, when you use the Back/Forward buttons. Move from one state to another, when you perform an action within your app (like clicking a link). Move to certain states that shouldn't be added to the history, like ones that appear after form submissions. Move to some states that are built on the previous state, like a drill-down list. When you perform actions within your app, there's the additional question of which comes first: Do you change the URL, listen for the URL change, and change your state in response to it? Or do you change your state, then change the URL, but don't do anything in response? Does anyone have some experience to share on this topic?

    Read the article

  • parameters in a seo url

    - by Marius
    This should be a very simple question for seo experts. Let's say we have the following URLs: http://www.test.com/some-sort-of-page http://www.test.com/some-sort-of-page?pgid1189 http://www.test.com/some-sort-of-page/page/1189 http://www.test.com/page/1189/some-sort-of-page The first one is an ideal solution. What i need to do is to somehow pass a resource identifier in the url to know exactly what this url is pointing to, since it can be pointing to a lot of different things. In the second URL, "pgid" specifies that the resource is a "page". URLs 3 and 4 specify the same thing differently. I do not care if the URL is friendly to people, because, let's face it - 99.9% of people will never ever ever bother to remember such url no matter how "friendly" it is. So the question is: which of the last 3 URLs would be the best solution for search engines? My guess is it would be the 2nd with query string, but i might be wrong. Thanks for your thoughts P.S. please don't offer using the first url. There's no problem using it, but the question is not about that.

    Read the article

  • Best/Easiest Technology for a RESTful webservice [closed]

    - by user1751547
    So I'm going to be creating a phone app + website that will need to utilize a web service. Webservices are completely outside my domain so I'm not entirely sure where to start. Does anybody have any suggestions on the technology stack I should use? (mainly in terms of ease of use and reliability) So far what I've looked at are: RoR Python + Django + TastyPie Python + Flask Microsoft WCF 3.5 PHP + some framework I would rather not do anything with Java I'm leaning towards the Python + Django + TastyPie route as it seems like it would be easy to get up and going and learn in general. My only concern with it is the reliability of the libraries (feature breaking updates, abandonment, etc). Also I would prefer to create the website with the same framework so I wouldn't have to deal with learning and using two different ones. Any advice would be helpful, thanks.

    Read the article

  • Restful WebAPI VS Regular Controllers

    - by Rohan Büchner
    I'm doing some R&D on what seems like a very confusing topic, I've also read quite a few of the other SO questions, but I feel my question might be unique enough to warrant me asking. We've never developed an app using pure WebAPI. We're trying to write a SPA style app, where the back end is fully decoupled from the front end code Assuming our service does not know anything about who is accessing/consuming it: WebAPI seems like the logical route to serve data, as opposed to using the standard MVC controllers, and serving our data via an action result and converting it to JSON. This to me at least seems like an MC design... which seems odd, and not what MVC was meant for. (look mom... no view) What would be considered normal convention in terms of performing action(y) calls? My sense is that my understanding of WebAPI is incorrect. The way I perceive WebAPI, is that its meant to be used in a CRUD sense, but what if I want to do something like: "InitialiseMonthEndPayment".... Would I need to create a WebAPI controller, called InitialiseMonthEndPaymentController, and then perform a POST... Seems a bit weird, as opposed to a MVC controller where i can just add a new action on the MonthEnd controller called InitialisePayment. Or does this require a mindset shift in terms of design? Any further links on this topic will be really useful, as my fear is we implement something that might be weird an could turn into a coding/maintenance concern later on?

    Read the article

  • RESTFul: state changing actions

    - by Miro Svrtan
    I'am planning to build RESTfull API but there are some architectural questions that are creating some problems in my head. Adding backend bussiness logic to clients is option that I would like to avoid since updating multiple client platforms is hard to maintain in real time when bussiness logic can rapidly change. Lets say we have article as a resource ( api/article ), how should we implement actions like publish, unpublish,activate or deactivate and so on but to try to keep it as simple as possible? 1) Should we use api/article/{id}/{action} since a lot of backend logic can happen there like pushing to remote locations or change of multiple properties. Probably the hardest thing here is that we need to send all article data back to API for updating and multiuser work could not be implemented. For instance editor could send 5 seconds older data and overwrite fix that some other journalist just did 2 seconds ago and there is no way that I could explain to clients this since those publishing an article is really not in any way connected to updating the content. 2) Creating new resource can also be an option, api/article-{action}/id , but then returned resource would not be article-{action} but article which I'am not sure if this is proper. Also in server side code article class is handling actuall work on both resource and I'm not sure if this goes against RESTfull thinking Any suggestions are welcomed..

    Read the article

  • Initiating processing in a RESTful manner

    - by tom
    Let's say you have a resource that you can do normal PUT/POST/GET operations on. It represents a BLOB of data and the methods retrieve representations of the data, be they metadata about the BLOB or the BLOB itself. The resource is something that can be processed by the server on request. In this instance a file that can be parsed multiple times. How do I initiate that processing? It's a bit RPC like. Is there best practice around this? (First time on programmers. This is the right place for this sort of question, right?)

    Read the article

  • ASP.NET Routing (in WebForms)not working when deployed under IIS,Works in IDE

    - by Shyju
    I have an ASP.NET web application(webforms,not MVC) developed in VS 2008 and i have implemented ASP.NET web forms URL routing by following this link http://www.4guysfromrolla.com/articles/051309-1.aspx#postadlink It works pretty good when i run it on the Visual studion IDE.But does not works when i created a site under my IIS (IIS 5.1 in XP) and deployed the same files there.I have set ASP.NET version as 2.0 in the Properties window of my application too.But does not work. Any idea Why ? Is there anything else to be setup ? Thanks in advance

    Read the article

  • ASP.NET MVC: Making routes/URLs IIS6 and IIS7-friendly

    - by Seb Nilsson
    I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7 and as we all know, IIS6 needs the ".mvc"-naming in the URL. Will this code work to make sure it works on all IIS-versions? Without having to make special adjustments in code, global.asax or config-files for the different IIS-versions. bool usingIntegratedPipeline = HttpRuntime.UsingIntegratedPipeline; routes.MapRoute( "Default", usingIntegratedPipeline ? "{controller}/{action}/{id}" : "{controller}.mvc/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); Update: Forgot to mention. No ISAPI. Hosted website, no control over the IIS-server.

    Read the article

  • How to deal with routing when developing a custom CMS in Codeigniter

    - by Ashley Ward
    Hi All - I’m a recent user of Codeigniter and am developing a simple backend CMS to manage pages. Based on a URL (in this example I have hidden “index.php”) : mysite.com/pagename I would like the system to detect if there is a value of “pagename” in my database, if there is, I need the system to re-route to a custom controller (eg: Pagemaker) and if there is no record called pagename, just do it’s normal thing (i.e. find a controller called pagename) Currently I have: $route['(:any)'] = "pagemaker/create/$1"; whereby all requests are forwarded to my custom function. However I want to change this structure so that if the page does NOT exist in the db, the traditional codeigniter request process is followed. Can anyone offer any advice about how to complete this? Or any advice about routing custom CMS’s in codeigniter in general?

    Read the article

  • Can you suggest good ways of generating URLS for viewing tagged content

    - by rikh
    For example, here on stack overflow the URL http://stackoverflow.com/questions/tagged/javascript+php will give you all questions tagged with javascript and php. The system I have allows tags with spaces in them, so the approach used here would not be a good fit for me. What character would you use to separate the tags, so the URLs are still human readable, google readable and web browser compatible. My gut feeling was to use commas. eg http://example.com/tagged/first+tag,second+tag Any feedback or suggestions would be welcome.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >