MarkMan5 Posted April 5, 2006 Share Posted April 5, 2006 How can I, or is it possible, to 'include' or 'require' a php page and send a query string as well?ex:[code]include $_SERVER['DOCUMENT_ROOT']."/help_page.php?table=gen_help";[/code]thanks! Link to comment https://forums.phpfreaks.com/topic/6691-include-or-require-a-php-file-with-query-string/ Share on other sites More sharing options...
Hooker Posted April 6, 2006 Share Posted April 6, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Example 16-7. include() through HTTP<?php/* This example assumes that www.example.com is configured to parse .php * files and not .txt files. Also, 'Works' here means that the variables * $foo and $bar are available within the included file. */// Won't work; file.txt wasn't handled by www.example.com as PHPinclude 'http://www.example.com/file.txt?foo=1&bar=2';// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the// local filesystem.include 'file.php?foo=1&bar=2';// Works.include 'http://www.example.com/file.php?foo=1&bar=2';$foo = 1;$bar = 2;include 'file.txt'; // Works.include 'file.php'; // Works.?> [/quote]:) Link to comment https://forums.phpfreaks.com/topic/6691-include-or-require-a-php-file-with-query-string/#findComment-24328 Share on other sites More sharing options...
MarkMan5 Posted April 6, 2006 Author Share Posted April 6, 2006 Sweet! It works now, thanks. I knew it was going to be an easy fix. Link to comment https://forums.phpfreaks.com/topic/6691-include-or-require-a-php-file-with-query-string/#findComment-24380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.