Combining form fields in url output

  HighTower 11:47 18 Sep 2006
Locked

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)

$full_date=$dd."/".$mm."/".$yyyy;

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

Yes!

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

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone