Displaying a PHP Include File

Any problem with PHP can be disscused here
Locked
pryj
Posts: 56
Joined: Tue Dec 21, 2004 1:06 pm

Displaying a PHP Include File

Post by pryj »

This is probably a stupid question, but I have to ask it. I have a forum that I'd like to display headlines from our site which are contained in a .php include file. How do I display this file at the top of the header?

Ian


Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

mhmm, try include ("http://example.com/header.php"); but i'm not sure that will realy work
Or other variant- use iframe
Image
mohumben
Posts: 82
Joined: Thu Sep 15, 2005 9:45 pm

Post by mohumben »

Well, displaying data in a php file is pure php basics. It depends on how the data is stored.
For example, let's say we have 2 files, data.php and show.php:

data.php:

Code: Select all

<?php

$header = "Welcome to my page";

?>
show.php:

Code: Select all

<?php

include 'data.php';
echo $header;

?>
D0M1N0R
Posts: 91
Joined: Tue Sep 20, 2005 8:05 pm

Post by D0M1N0R »

Yeah that should work, BUT what exactly are you trying to do, didnt get it, or s it just as basic as showing that? why dont do that in html, and add php in the same site?
toychoq
Posts: 108
Joined: Fri Apr 15, 2005 9:11 am

Post by toychoq »

good scripts
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

One more sollution- edit template files, but be careful, do backups and do not delete any in this, only add your own source
In template file add iframe or smth and add script in html language, because mostly templates are created in html

I think this topic should be locked, because all kind of sollution is mentioned here

-=LOCKED=-
Image
Locked