Finally found a PHP forum that follows web standards AND isn't bloated. I've been trying to add a header bar to a PHP script but it just doesn't like it. Just get errors whever i put the code. I'd show you but i'm not allowed.. If anyone could help it would be great, thanks. Pete
You want to inject some html in php? If thats what you are asking you have to use the include function. like this include 'yourhtml.html'; Code (markup): and the yourhtml.html file obviously holds what you want to inject into the php script. or you can use the print function like print '<pre> this is html </pre>'; Code (markup): Im just learning php so tell me if that what you are talking about.
Nothing could be simpler. Save the following as test.php, put in your website and try to connect to the page. <?php include "head.html"; echo '<p>php works here</p>'; ?> <p> Click on me <a href="test.php"> click me</a></p> </body> </html> Code (markup): Create a second file called head.html and put this text in it: <html> <head> <title>Imported header</title> </head> <body> Code (markup):
If you need like a link within the php code say in a loop or something echo "<a href=\"link.php\"> YOOYOYO</a>";
This is the error message i'm getting: Warning: Cannot modify header information - headers already sent by (output started at /home/fhlinux187/p/publicwarehouse.co.uk/user/htdocs/forum/uploads/header.php:5) in /home/fhlinux187/p/publicwarehouse.co.uk/user/htdocs/forum/uploads/index.php on line 1951
Ah! I was playing around with positions and worked when i put it over the table not at the very top. Thanks a lot, it's perfect