Browsing articles tagged with " get"
Feb
21

How to use GET data with PHP include

While working on many of my projects, I have stumbled upon the same problem frequently when including files; PHP won’t allow you to pass GET values in the filename:

include('file.php?get=data'); // will not work

While looking for an easy work around, ’cause lets face it, I don’t have time to overhaul the entire script, I found this neat little trick:

$_GET['get'] = 'data';
include('file.php);

Simply set the GET information manually before including the file.