PHP form, checking 2 dates aren't too far apart
<p>I've been thrown in at the deep end at work, I grew up knowing plain HTML (mid-90's) and I've been asked to alter a form at work that's in PHP, I can alter PHP code written by others, but there's no way I could write it myself. I've altered this form to just about how I want it, but there's 1 bit I want to alter, if anyone can help it would be greatly appreciated...</p>

<p>been on this for 2 days searching the web and trying stuff, I have the following</p>

<pre><code> &lt;p class="quest"&gt;Date from: &lt;input type="text" name="acc2" class="tcal" value="" /&gt; to: &lt;input type="text" name="acc3" class="tcal" value="" /&gt;
</code></pre>

<p>it uses javascript to pop up a calendar (tigra calendar) that then returns 2 dates (acc2 and acc3), the dates are in d/m/Y (DD/MM/YYYY) format (standard here in Europe/Aus/NZ).
What I'm wanting to do is get it to check if the difference is greater than 42 days (6 weeks), if it is I want it to display some text with a link (42 days or less is fine).
If I put on the page as a test:</p>

<pre><code>&lt;?php echo($acc3); ?&gt;
</code></pre>

<p>then it displays  1341442800  on the page (before a date is chosen), if the user selects a date then the above number stays (not dynamic)</p>

<p>Is what I'm wanting possible?
If not, can it be checked on submission and pop up an alert (without the link)?
I currently use Javascript to check the form, an example is:</p>

<pre><code>&lt;script language="javascript" type="text/Javascript"&gt;
    &lt;!--
        function collect()  {
            if(document.all.ct.value == "TempAcc")
            {
                if(document.all.acc7.value.length &lt;11)
                {
                    alert("You need to fill in your contact number with your FULL number including STD code.");
                    return false;
                }
            }
        }//end function collect
    //--&gt;
    &lt;/script&gt;
</code></pre>

<p>any help with this would be very much appreciated, please try to be specific with any code as I'm am still very much a beginner.
Thanks in advance.</p>
