Web Hosting Talk







View Full Version : php page


hotneomatrix
06-21-2005, 07:13 PM
hello,

i need to display banners in right side, left side , top and bottom of all pages in my website without changing the codes of the site.

So will it be possible to do something like this [i mean without using frames, coz if i use the frames and insert the page the frames wont get refreshed ]?

i mean, i will add topbanner.php, footerbanner.php, rightsidebanner.php and leftsidebanner.php

so im thinking of making another php file, which will insert [index.php] in the middle, and insert the above files in appropriate position.

But my problem is when a person clicks on any link in index.php, it will take him to another page and the banners will disappear.

So i need a code which will display all the pages inside ONE php file which have banners.

will it be possible ?
Can anyone help me?

thanks in advance..

azizny
06-21-2005, 07:54 PM
Easy, just think of this:

make an index.php page which will display the "framed" page and when $_GET['page'] is empty or it equals index.php it will display index.php. Change your links to ?page=pagename.php and just always include($_GET[page])...

Peace,

P-nut
06-21-2005, 11:05 PM
I would caution strongly against using a method that lists the full filename as they are often exploited by hackers.

See this link:
http://infernoforums.com/showthread.php?&t=124&page=1&pp=10
for using a php template system that will give you a ?p=something URL while providing a touch more security.

xelav
06-22-2005, 01:33 PM
better use template-based site engine - in this case you will need to edit one template and insert banners as you want

hotneomatrix
06-22-2005, 03:20 PM
thanks buddies for all ur replies..

I wish to know whether itz really required to edit and put table or something like tat to insert the banners in the template?
i mean for alignment of the banners on all sides of the site as i told earlier ?

kuja
06-24-2005, 01:05 PM
You may also check auto_prepend_file and auto_append_file within your php.ini

WLHosting
06-24-2005, 07:02 PM
Originally posted by azizny
make an index.php page which will display the "framed" page and when $_GET['page'] is empty or it equals index.php it will display index.php. Change your links to ?page=pagename.php and just always include($_GET[page])...

Well, you can still do this, but remove the extension on the query string from the file in the url. Then add a safe files array and if it is in the array, then include it. That will make your script only include the files you wish, and if the file is not in the array it will show the default page. This will also eliminate the is_file() information as well.