Combining form fields in url output

  HighTower 11:47 18 Sep 2006

I have a form which contains a number of fields, such as departure airport, destination, max price etc. Another of these fields are departure dates which need to be sent to a url as part of a string. I guess that the page this url is sent to then parses the url and returns the search results accordingly.

What I need to do is send the results from the three existing fields (DD, MM, & YYYY) to the url as one field (DD/MM/YYYY).

I'm writing the site in PHP, but maybe it's a javascript I need to look at which combines these fields into one?

An answer in nice, easy, idiot proof, plain English would really make my day! Thanks.

  harristweed 11:55 18 Sep 2006

To join 3 variables in to one: do it like this(php)


if $dd=12 and $mm=05 and $yyyy=2006
'$full_date' will be '12/05/2006'

how this works: the '.' joins the various parts together, so $dd."/" will add a slash after the digits 12 (12/)then the second . will add (mm) 05 (12/05)and so on.

  HighTower 13:58 18 Sep 2006

HarrisTweed, seems like you have become my personal coding support contractor. Your rates are certainly very favourable anyway. I appreciate all of your help, I'm most grateful.

I'll try this out, if I can get it to work I'll owe you big style!

  HighTower 14:01 18 Sep 2006

So do I just need to label the three text fields in the form dd, mm, yyyy and then add this code to create a new variable called full_date (or whatever I choose to call it)?

  harristweed 14:22 18 Sep 2006


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Honor 9 Lite review

How Social Media has Propelled Political Graphic Design and Art in the Last Decade

The best kids apps for iPhone & iPad 2018

HomePod d’Apple : date de sortie, prix et fiche technique