-1

I am trying to include a page using php include.

The problems is I need to include a query string and the include call fails, i.e.:

<?php include($urlroot.'/discounts/relatedcontent.php');?>

retrieves that page successfully but when I try

<?php include($urlroot.'/discounts/relatedcontent.php?tag=health');?>

the php include call fails.

How come and what can I do about it. I need to pass the value of tag to the $urlroot.'/discounts/relatedcontent.php' page

Nigel Ren
  • 56,122
  • 11
  • 43
  • 55
Evan TOder
  • 75
  • 1

1 Answers1

0

You can't include path of file with GET parameter. Because include get file name as it is and can't handle any rules like ?tag=health. Instead of this, you need detach part of this script, that generates, when get ?tag=health and include it separately.

zen
  • 980
  • 6
  • 18