Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to Pass Parameters via URL

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 04-03-2009
Member
 
Join Date: Feb 2009
Posts: 71
unsure How to Pass Parameters via URL
  

Hello,

Can anyone tell me how do we pass the parameter through URL, i heard that it is possible to pass parameters via URL, and to pass these parameter via URL should we have to edit the URL and pass the parameters in it, if this would be possible then i think this would be new thing I can implement in my project, so please help...

Thanks for your reply.

Reply With Quote
  #2  
Old 04-03-2009
Member
 
Join Date: Apr 2008
Posts: 193
Re: How to Pass Parameters via URL

In your postback function, add the following code:

Response.Redirect("your_url.aspx?your_url_variable=" + @variable_from_form);

Hope this is what you're looking for!
Reply With Quote
  #3  
Old 04-03-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: How to Pass Parameters via URL

In javascript window.location.href can be used to obtain the url. From which, parameters can be parsed and actions taken.

The attached example project demonstrates starting a wavemaker project on a page. A cust id could be handled in similar fashion.

In this example we used some reg exp to define a function that extracts a parameter from the href ( var results = regex.exec( window.location.href ); ). In the start function for the main page we get our 'page' parameter ( var page_name=this.getParam('page'); ) and set the contents of pane1 accordingly ( this.pane1.setPageName(page_name); ).

Starting the application on page two is simply a matter of passing page=ptwo on the application URL.
Reply With Quote
  #4  
Old 04-03-2009
Member
 
Join Date: Dec 2008
Posts: 202
Re: How to Pass Parameters via URL

A URL parameter is a name/value pair appended to a URL. The parameter begins with a question mark (?) and takes the form name=value. If more than one URL parameter exists, each parameter is separated by an ampersand (&). The following example shows a URL parameter with two name/value pairs:

URL parameters let you pass user-supplied information from the browser to the server. When a server receives a request, and parameters are appended to the URL of the request, the server puts the parameters at the disposal of the requested page before serving that page to the browser.

In this example, imagine that the application is a web-based storefront. Because the developers of the site want to reach the widest possible audience, they have designed the site to support foreign currencies. When users log in to the site, they can select the currency in which to view the prices of the available items.
  1. The browser requests the page report.cfm from the server. The request includes the URL parameter Currency="euro". The Currency="euro" variable specifies that all monetary amounts retrieved be displayed as the European Union euro.
  2. The server temporarily stores the URL parameter in memory.
  3. The report.cfm page retrieves and uses the parameter to retrieve the cost of items in euros. These monetary amounts can either be stored in a database table of different currencies, or converted from a single currency associated with each item (any currency supported by the application).
  4. The server sends the report.cfm page to the browser, and displays the value of items in the requested currency. When this user terminates the session, the server destroys the value of the URL parameter, freeing up server memory to hold the requests of new users logging in to the site.


The following illustration shows how an application server processes a URL parameter.

URL parameters are created when the HTTP's GET method is used in conjunction with an HTML form. The GET method specifies that the parameter value be appended to the URL request when the form is submitted.

Typical uses of URL parameters include personalizing websites based on a user's preferences. For example, a URL parameter consisting of a user name and password can be used to authenticate a user, displaying only information that user has subscribed to. Common examples of this include financial websites that display individual stock prices based on stock market symbols the user has previously chosen. Web application developers commonly use URL parameters to pass values to variables within applications. For example, you could pass search terms to SQL variables in a web application to generate search results.
Reply With Quote
  #5  
Old 23-09-2009
Member
 
Join Date: Sep 2009
Posts: 1
Re: How to Pass Parameters via URL

Hi, I'm learning the basics of .html and am wondering how I can pass a parameter to another server. Man, how do I explain this? ...

An html guy set up his server to display my content-

ie: He setup his server..
... to display any content from my server. Anything below the following directory...
He said he did this by setting up "content.html" on his server with an iframe to display anything I want in the iframe by "passing parameters" over to him.

He said he hard-coded the beginning of the URL with my server path "http://mystuff.com/newContent/" and that ultimately, his server would display my "NEW.swf" within HIS root URL.

Like this:

would display in a browser as...
He got this part to work but is now unavailable.

I just can't figure out how to pass the parameter so it works right and displays a PDF properly (User has to click on a link inside the SWF to open an new window where the PDF should be (with HIS URL))...

He said to use:
Quote:
?src=MYPDF.pdf&layout=false
But I keep trying variations of that, but it keeps displaying in MY URL.

I guess I need to know what URL to put in my SWF?

Thanks in advance...
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Pass Parameters via URL"
Thread Thread Starter Forum Replies Last Post
How to pass parameters to a workflow B-JOB Guru Windows Software 3 25-02-2011 06:13 AM
Network Diagram - Configure to show Forward Pass/Backward Pass m3lyssa Microsoft Project 9 30-08-2010 04:57 PM
How to pass function with parameters to another function in PHP? Linoo Software Development 5 27-02-2010 06:52 PM
Pass Parameters To A Popup in Java Adrina_g Software Development 4 23-02-2010 08:01 PM
How to Pass Parameters to Functions super soaker Software Development 3 31-12-2009 11:16 AM


All times are GMT +5.5. The time now is 09:38 PM.