aquatsr Posted September 1, 2006 Share Posted September 1, 2006 I have the code below in a file called index.php. The problem I'm having is that the code in the test.php is not executing. In all the other include files there is HTML but in test.php there is php code. And that code isn't executing. Can anyone shed some light on the problem? <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en"><head><link rel="stylesheet" type="text/css" href="stylesheet2.css" /></head><body><ul id="topnav"><?php include('navigation.php'); ?></ul><div id="topad"><?php include('topad.php'); ?></div><div id="topscroll"><?php include('topscroll.php'); ?></div><div id="sidenav"><?php include('sidenav.php'); ?></div><div id="sidead"><?php include('sidead.php'); ?></div><div id="content"><?php include ('test.php'); ?></div><div id="bottomad"><?php include ('bottomad.php'); ?></div><div id="footer"><?php include ('legal.php'); ?></div></body></html> Link to comment Share on other sites More sharing options...
aspnetguy Posted September 1, 2006 Share Posted September 1, 2006 can we see the php in test.php? Link to comment Share on other sites More sharing options...
aquatsr Posted September 1, 2006 Author Share Posted September 1, 2006 well it's very simple, as I was testing it.When I put $p = 3;echo $p; in test.php it shows $p=3;echo $p; in the page.But when I put <?php$p = 3;echo $p;?> nothing happens. Link to comment Share on other sites More sharing options...
aquatsr Posted September 1, 2006 Author Share Posted September 1, 2006 Parse error: syntax error, unexpected T_INCLUDE in /usr/local/apache2/htdocs/aquatsr/projects/lyrics/php/test.php on line 8 OK found the parse error I'm done. Link to comment Share on other sites More sharing options...
Jack McKalling Posted September 1, 2006 Share Posted September 1, 2006 Has this been solved for you now?Remember to always put PHP tags inside the included files, even they get included inside a php script. And the url of the included file must be compared to the folder the including file is in, or else no file will be included (I don't understand that part myself though). Link to comment Share on other sites More sharing options...
reportingsjr Posted September 1, 2006 Share Posted September 1, 2006 It looks like he has the php tages in text.php, try putting qoutes around the 3.I just thought this was odd, but on every other include you have everything to include it on one line, but for test.php its on 3 lines =\. I know, its just bugging me! Link to comment Share on other sites More sharing options...
Little Goat Posted September 2, 2006 Share Posted September 2, 2006 there is a space in between the include and the brackets () like this: include ('text.php)//space hereinclude('text.php)//none here not sure if that changes anything, but try it anyway. Link to comment Share on other sites More sharing options...
Jack McKalling Posted September 2, 2006 Share Posted September 2, 2006 No, functions may have spaces between their name and their parameter delimiters, their brackets :)This is the same: include("something"); As: include ("something"); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now