php - send a variable through url in Include -


i trying send variable "q" search page through url. error saying

fatal error: require(): failed opening required 'theme/_modules/contact/search.php?q={echo $q;}' (include_path='.:/usr/lib/php:/usr/local/lib/php')

here code

    if(isset($_post['q'])){     $q= $_post['q'];     }      require 'theme/header.php';     require 'theme/_modules/contact/search.php?q={echo $q;}';     require 'theme/footer.php'; 

can 1 tell me reason , way on come problem.. thank you..

after doing this..

require 'theme/header.php'; //require 'theme/_modules/contact/search.php?q={echo $q;}'; require "theme/_modules/contact/search.php?q=$q"; require 'theme/footer.php'; 

i error

 warning: require(theme/_modules/contact/search.php?q=saman): failed open stream: no such file or directory in /home/dr7bf45v/public_html/search.php on line 17 

i think trying go on wrong way.

you trying accomplish remote including. (1. must allow it: including remote file in php. 2. link should looks url).

now trying require theme/_modules/contact/search.php?q=saman it's mean script looking file name search.php?q=saman. have file? no. search.php.

but, think, trying pass variable file scope. there better way this. require without params.

p.s. if search.php receives value , need result use curl because remote including dangerous.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -