Ok im trying to include an html file inside some php quotes... heres what i got so far that does not work, i really cannot find the problem. Inside the 1001 files is plain HTML. $bannersee = "<center> <a href='http://www.x.net/' target='blank'><img src='http://www.x.com/images/x.jpg' alt=X' border='0' /></a><br> <br>".include( "/home/httpd/vhosts/x.com/httpdocs/hardlinks/data/output/1001" ).""; echo "</center>"; dcb("Friends", 3, $bannersee); PHP:
The php part should be like this: $bannersee = "<center> <a href=\"http://www.x.net/\" target=\"blank\"> <img src=\"http://www.x.com/images/x.jpg\" alt=\"X\" border=\"0\" /></a><br> <br><br>". include( "/home/httpd/vhosts/x.com/httpdocs/hardlinks/data/output/1001" ); echo "</center>"; dcb("Friends", 3, $bannersee); Or, u can try this: $bannersee = "<center><a href=http://www.x.net/ target=blank> <img src=http://www.x.com/images/x.jpg alt=X border=0 /></a><br> <br><br>". include( "/home/httpd/vhosts/x.com/httpdocs/hardlinks/data/output/1001" ); echo "</center>"; dcb("Friends", 3, $bannersee);
I don't even think that would work as include doesn't return strings, it processes files and would output the HTML straight away that is included. There's nothing wrong with the use of quotes that I can see. Essentially the problem is that include doesn't work how you seem to think it works. If you want get the contents of a file into a variable, instead of using the include to append the content to a string, use the file_get_contents() function to read the HTML (content) from the file into a variable and then append that new variable in place of the include.