Larry Vollmer
asked on
PHP Date question
http://calendar.site.com/calendar.php?query=SearchCategory=&SearchDate=&SearchDateEnd=
I need to plug in the present days date here > &SearchDate=
and the date a week from the present day here &SearchDateEnd=
Can anyone help me out?
I need to plug in the present days date here > &SearchDate=
and the date a week from the present day here &SearchDateEnd=
Can anyone help me out?
ASKER
logically it works, but i have to put %2F instead of slashes in between the date
IE today would look like:
&SearchDate=2008%2F10%2F27
IE today would look like:
&SearchDate=2008%2F10%2F27
$twoF = '%2f';
echo "http://calendar.site.com/calendar.php?query=SearchCategory=&SearchDate" . rawurlencode(date("Y m d",strtotime("now"))) . "=&SearchDateEnd=" . rawurlencode(date('Y m d',strtotime("+7 days")));
not clear what you mean but try:
echo "http://calendar.site.com/calendar.php?query=SearchCategory=&SearchDate" . urlencode(date("m/d/Y",strtotime("now"))) . "=&SearchDateEnd=" . urlencode(date('m/d/Y',strtotime("+7 days")));
ASKER
Neither of those methods worked.
here is a sample of what the date string should look like:
&SearchDate=2008%2F10%2F27 &SearchDat eEnd=2008% 2F11%2F3
here is a sample of what the date string should look like:
&SearchDate=2008%2F10%2F27
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hmm let me try again.
ASKER
Wow that is weird. When I mouse over the link it puts slashes in, but when I click the link it uses the %F2 - thanks for the help.
you are welcome
echo "http://calendar.site.com/calendar.php?query=SearchCategory=&SearchDate" . date("Y-m-d",strtotime("no
if you want m/d/Y then change:
Y-m-d
to:
m/d/Y