<script type="text/javascript">
var month = "12";
var day = "12";
var year = "2012";
var area = "02";
var url = "http://www.google.com?year="+year+"&month="+month+"&day="+day+"&area="+area;
document.write("<a href="+url+">this link");
</script>
<?php
$sysdate = date("d,m,Y");
?>
This will return a variable value of DDMMYYYY format and it can be altered to include special characters in the return value.
Based on the URL example you provided, you are using a _GET method to submit form data to the next page using PHP.
What you will need to do is embed a PHP script within your JavaScript to dynamically generate the values needed for the JavaScript to work. See example below:
Open in new window
At this point you can use the variables generated by PHP within your JavaScript construct using the JavaScript variables. Notice the difference between the PHP variable and JavaScript syntax. PHP uses the $ symbol to denote a variable, but JavaScript does not require any prefix.