Thanks to all who offered solutions to this. I thought quotes around a
variable name within the URL was necessary syntax. So I now escape the
quotes and the variable content no longer contains unwanted characters.
Also converting the date using strtotime(), after first rearranging from
m-d-y to y-m-d sure worked for me. That list($m,$d,$y) = preg_split('/-/',
$TheDate), suggested earlier, was also useful in getting there.
> You should start with using quotes in your html syntaxis, i.e.:
<a href="........" title=".....">...</a>
to print() this you'll need to escape the quotes:
<a href=\".......\" title=\".....\">...</a>
print "<A HREF=\"DisplayCalendar.php?TheDate=$m-$d-$y\">$d</A>";
that way you'll get ridd of the single quote's you used.
if you want today's date in us format, you can use
sprintf("%02d-%02d-%04d", strftime("%m"), strftime("%d"), strftime("%Y"))
if you want to put in you're 'href' I'll advise the following construct:
print "<A HREF=\"DisplayCalendar.php?TheDate=".sprintf("%02d-%02d-%04d",
strftime("%m"), strftime("%d"), strftime("%Y"))."\">$d</A>";
>My first page sets a variable and then loads a second page via A HREF. The
>relative link with variable appended is generated in the following fashion:
>print "<A HREF =DisplayCalendar.php?TheDate='$m-$d-$y';"\>$d</A>";
>That variable content is visible in the resulting URL but I am not able to
>isolate the content to a formate I can use. I need a U.S. date which I can
>modify to a UNIX format but the date variable is plagued with unintended
>slashes and single quote characters. I've tried using the stripslashes()
>function but that still leaves the single quotes on either side, with a
>semi-colon following the closing single quote.
>What I get before applying the stripslashes() is the following:
>After the stripslashes() the value is:
>How can I filter this content?