Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The VeryTime,Stay informed and read the latest news today from The VeryTime, the definitive source.

How to Use Multiple Variables in an Address String

25
    • 1). Open a web browser and enter the following URL in the address line:

      http://www.amazon.com

      After a short wait, you will see the Amazon home page.

    • 2). Search for books on PHP. Choose "books" in the search list, enter "PHP" in the search text box then click the search button. After another short wait, your search will appear. Look at the address box and observe the URL. It will appear something similar to the following:

      http://www.amazon.com/s/ref=nb_sb_noss?URL=search-alias%3Dstripbooks&field-keywords=php&x=0&y=0

      Notice how the URL includes a question mark followed by pairs of names and values. Each variable includes a name, an equal sign and a value. Additional variables are separated by an ampersand sign.

    • 3). Create a sample link. On a site that manages appointments, the first page may list each appointment with date, time and the appointment name. When the user clicks the name, a detail page appears listing the individual appointment. A typical URL for this link may appear as follows:

      http://www.appointments.com/appointmentDetail.aspx?date=2011034&time=1100

      In this case, the appointment detail page is directed to find the appointment for the 34th day of 2011 (2/3/2011) at 11:00 am. Each appointment would have a similar link with variables indicating the date and time of the appointment.

      Note the aspx extension on the appointment detail page. Some type of server side scripting is necessary to interpret these variables. In this case ASP.Net code is used. Java, PHP, CGI or some other technology may also be used to interpret these variables.

    • 4). Interpret the variables. Most server side scripting languages offer a way to parse these variables into name and value pairs. In ASP.Net, the variables can be retrieved as follows:

      DateValue = Request("date")

      TimeValue = Request("time")

      In PHP, this is done with:

      $dateValue = $_GET("date");

      $timeValue = $_GET("time");

      Variables are always retrieved as text strings, so it is the programmer's responsibility to translate these text fields into an appropriate data type or format.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.