Results 1 to 7 of 7

Thread: php page

  1. #1
    Join Date
    Jun 2005
    Posts
    46

    php page

    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..

  2. #2
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,342
    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,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  3. #3
    Join Date
    Jun 2003
    Location
    Proud She-Geek
    Posts
    1,722
    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....4&page=1&pp=10
    for using a php template system that will give you a ?p=something URL while providing a touch more security.
    <?php echo "Signature here"; ?>

  4. #4
    better use template-based site engine - in this case you will need to edit one template and insert banners as you want
    HostNodeList Web Host Directory, DEV.INTOEX.COM - products for online business

    Experienced web-developer | PHP | Smarty | Zend | Databases | Graphic design - looking for long-time relationship

  5. #5
    Join Date
    Jun 2005
    Posts
    46
    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 ?

  6. #6
    You may also check auto_prepend_file and auto_append_file within your php.ini

  7. #7
    Join Date
    Mar 2003
    Location
    South Bend, Indiana, USA
    Posts
    320
    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.
    Daniel
    WLScripting.com - php scripts and tutorials

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •