mnybud Posted July 30, 2007 Share Posted July 30, 2007 Simple question I think.... I have a existing script that calls a keyword like this... <?php keyword() ?> I have another external script that I call like this normally <?php include("http://www.domain.com/query.php?query=keyword"); ?> I am trying to make this work.... <?php include("http://www.domain.com/query.php?query=<? keyword() ?>"); ?> How do you include PHP within PHP like this? Quote Link to comment Share on other sites More sharing options...
morphboy23 Posted July 30, 2007 Share Posted July 30, 2007 Maybe try something like.. <?php include("http://www.domain.com/query.php?query=" . keyword() . ">"); ?> Quote Link to comment Share on other sites More sharing options...
jitesh Posted July 30, 2007 Share Posted July 30, 2007 (1) Include needs root path not a server path. (2) The variable can be use in included files. Example mainfile.php <?php $keyword = "search"; include("included_file1.php"); ?> included_file1.php <?php echo " This is the keyword of mainfile ".$keyword; ?> Quote Link to comment Share on other sites More sharing options...
mnybud Posted July 30, 2007 Author Share Posted July 30, 2007 <?php include("http://www.domain.com/query.php?query=" . keyword() . ">"); ?> doesnt work for me but I think thats what I am looking for.... I dont really understand this example... Example mainfile.php <?php $keyword = "search"; include("included_file1.php"); ?> included_file1.php <?php echo " This is the keyword of mainfile ".$keyword; ?> ... Quote Link to comment Share on other sites More sharing options...
mnybud Posted July 30, 2007 Author Share Posted July 30, 2007 can anyone help me with this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.