-1

I created a function in wich i create a Table.
The function itself runs fine, but i want an link to another Page.
Inside that Page I work with GET Variables, so they need to go inside the URL.
I got:

$calendar.= '<div class="day-number"><a href="http://localhost/PHPOrdner/Calendar/Day.php?inputmonth='$inputMonth'&inputyear='$inputYear'&day='$list_day'"></a>'.$list_day.'</div>';

But that isn't working:

Parse error: syntax error, unexpected '$inputMonth' (T_VARIABLE) in...

I tried to escape the ' like: .../Day.php?inputmonth=\'$inputMonth\'...
But that gives me ".../Day.php?inputmonth=%27$inputMonth%27..." in my URL so the Code, where i need the variables doesn't work.

Using <?php echo "..."; ?> also doesn't work.
I'm still new to this, are there any other ways?

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34
Piratenlulatsch
  • 75
  • 1
  • 2
  • 10

2 Answers2

0

Your string concatenation is wrong you forgot the .

Try:

$calendar.= '<div class="day-number"><a href="http://localhost/PHPOrdner/Calendar/Day.php?inputmonth='.$inputMonth.'&inputyear='.$inputYear.'&day='.$list_day.'></a>'.$list_day.'</div>';
caramba
  • 21,963
  • 19
  • 86
  • 127
0

You lack .

$calendar = '<div class="day-number"><a href="http://localhost/PHPOrdner/Calendar/Day.php?inputmonth='.$inputMonth.'&inputyear='.$inputYear.'&day='.$list_day.'"></a>'.$list_day.'</div>';
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46