Jump to content

code not displaying anything


aquatsr

Recommended Posts

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...