Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14

Thread: PHP & HTML

  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP & HTML

    Does anyone know if you can call php files into html tables?


    Im trying to get a php file to load into a table on an html file and I am not having any luck with it. Thought it best to find out if this is even possible before I spend anymore time on it.

    THanks for your help/board,
    david

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You can only parse PHP code in files with .php extensions or other extensions designated to be parsed by the PHP parser.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So if I make the html file a php file I would be able to call the php file I want to call into the html file?

  • #4
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This what I did. Still have yet to see if it works...

    I made the original HTML file a php file using dreamweaver mx.

    I setup a test box for this and included in the php file a statement that says
    <?php include('index.php') ?> and placed it in the includes directory.

    No errors but its just hanging there like its downloading. Any suggestions or thoughts on this?

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I think maybe you don't quite understand how PHP works. PHP files can have HTML code in them. PHP code is parsed and executed on the server, the parser then outputs nothing but client side code like HTML, CSS, Javascript or whatever back to the browser.

    If you want to use PHP in your website either you need to change the file extension of your .html files to .php and or you need to configure your server to parse .html files using the PHP parser. The first option is the most logical solution.

    Just mix the PHP code in with your HTML code where you need it.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by dlsodders
    This what I did. Still have yet to see if it works...

    I made the original HTML file a php file using dreamweaver mx.

    I setup a test box for this and included in the php file a statement that says
    <?php include('index.php') ?> and placed it in the includes directory.

    No errors but its just hanging there like its downloading. Any suggestions or thoughts on this?
    It's possible the include path in the PHP configuration file does not currently have your include directory listed.

    Try putting that included file in the same directory as the file it is being included in. If it works then the problem is with your include path not being set properly.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can we chat in yahoo?

    Your right, I dont understand it, in fact Im new to it.

    I have been able to go through it and customize php scripts I have found on the web but Its time I start to get a little more involved in it.

    I would like to be able to give back to the open source community some day.

  • #8
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I'm guessin the page is hanging as the page you put the
    <?php include("index.php"); ?>
    code in is also called index.php? If it is then all you're doing is creating an infinite loop

  • #9
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I only provide help via the forums here so that everyone can benefit from the questions and anwers.

    A good place to start learning is by reading the PHP manual

    http://www.php.net/manual/en/

    There are also lots of tutorials and information at its sister site www.zend.com

    www.phpfreaks.com also has some decent tutorials.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #10
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thats a pretty good guess, and the answer is yes, that is exactly what Im doing.

    What im trying to do is get the FAQ system of Helpcenterlive to load into the site design of my information section.

    You can visit it here http://worldofcomputersinc.com/information

    Note: right click is disabled for now.

    However, the faq main page is called index.php and Im betting if I renamed it it would work.

    Do you think it would work if I named the index.html file that i converted to a php file something other than index.php?

  • #11
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay that sort of worked!


    Man I wish you could talk over IM with me quickly, with your experience you would prolly be able to help me get this right quickly. I tell you what, Im pretty excited that I got it to load

    this is what im getting now http://worldofcomputersinc.com/products/hcl/faq/faq.php

    Any suggestions?

  • #12
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    faq.php doesn't exist, just go to http://worldofcomputersinc.com/products/hcl/faq/

  • #13
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah I know, I removed it.


    I did get the code to be called using the include statement. It pulled what you saw at http://worldofcomputersinc.com/products/hcl/faq/ into the faq.php file. Which is what I wanted, however I want the entire app to stay in a table whereas when I clicked on a generic FAQ Title, it takes me to another php page and Im not sure how to get all of it to load into one file in the same place.

  • #14
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Ever heard of the phrase, if it ain't broke, don't fix it? And I also don't understand what you mean, it does all work off one page, index.php


  •  

    Posting Permissions

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