SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Dec 2001
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get a .php file in the middle of my .html file???

    Ok...

    I have:
    http://www.webguyz.ws/countdown.php

    I want it on the main page:
    http://www.webguyz.ws/

    right under
    50% OFF WEB HOSTING SALE! **EXTENDED**
    See Details

    How on god's green earth do I get it there??????

    Never mind, just plain stupidity not to put the entire script into the .html file! Sorry!
    Last edited by webguyz; May 13, 2002 at 08:05.

  2. #2
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're going to have to change the extension of the main page from .html to .php. Then, open the code for the main page (now renamed to .php) and add this line of code where you want the countdown file to be included:
    <? include("countdown.php"); ?>

    That should do it. If you can't change the extension to anything other than .html on the main page, you can't include the php file on it.
    Marc Gugliuzza
    marc.gugliuzza.com



  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Easy solution is using IFRAME:
    Code:
    <IFRAME SRC="http://www.webguyz.ws/countdown.php"></iframe>
    You can also specify the width and height of the IFRAME.

  4. #4
    I'm a college yuppie now! sbdi's Avatar
    Join Date
    Jul 2000
    Location
    Dublin , Ireland
    Posts
    1,271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesnt Iframe only work in IE though ?.

    Just use a include line.
    Back Again

  5. #5
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea, I think IFRAME only works in internet explorer as well..

    Another possible solution is to just get a countdown script written in javascript, they're quite widely available, and put that right in on your html page.
    Marc Gugliuzza
    marc.gugliuzza.com



  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Marc
    Yea, I think IFRAME only works in internet explorer as well..
    sbdi
    Doesnt Iframe only work in IE though ?.
    IFRAME is in HTML 4.0 specifications, and I know NS6 is supporting it.

  7. #7
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The include suggestion is your best bet, and if you can't afford to change the homepage filename from .html to .php (because you have too many incoming links there) you SHOULD be able to alter the file processing rules so that .html files are processed as PHP (you can do the same with ASP). This will let you keep the filename but use the PHP include.


    M@rco

  8. #8
    SitePoint Guru Marc's Avatar
    Join Date
    Nov 2000
    Location
    New York
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    M@rco's suggestion is quite true. You would have to do that in the configuration files for your webserver. I know if you are using Apache, it's as simple as opeing httpd.conf and adding .html to the line with .php.
    Marc Gugliuzza
    marc.gugliuzza.com



  9. #9
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bingo!


    M@rco


Bookmarks

Posting Permissions

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