SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot lightwithoutheat's Avatar
    Join Date
    Feb 2002
    Location
    Washington DC
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    converting an .shtml page into a .php page?

    I have an .shtml page which uses a couple ssi includes. I recently added a php script and turned the page into a .php page and now the includes don't work. I need to fix this somehow to display the ssi's on the page along with the php script.

    I have no php experience, but need to learn. Can anyone help me out with this (simple?) problem? Thanx...

  2. #2
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't quote me on this since I'm not sure, but you might try adding a .htaccess file to make the server parse shtml as php?

    I dunno for sure though.
    You smell something?

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    change your ssi includes to
    PHP Code:
    include("/path/to/file/file.ext"); 
    Should work fine.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alternatively, you could use require() in much the same way. "The two constructs are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error."

  5. #5
    SitePoint Zealot lightwithoutheat's Avatar
    Join Date
    Feb 2002
    Location
    Washington DC
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much Defender1!

    I tried the include("/path/to/file/file.ext"); and it worked absolutely fine. You have certainly earned your place on the PHP Forum.

    Thanx much people!

  6. #6
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heh thx...
    I guess that's why I used to be a mentor?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  7. #7
    SitePoint Zealot Klav's Avatar
    Join Date
    Mar 2002
    Location
    Huddersfield, UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could have also created a .htaccess file and added AddType Application/x-httpd-php .shtml to it. This way the page would allow SSI includes as well as PHP code to be executed. Just a thought.

    Klav

  8. #8
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As long as the ssi calls weren't between the <? and ?>
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •