...

View Full Version : PHP & HTML



dlsodders
06-10-2004, 04:08 PM
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

Spookster
06-10-2004, 04:30 PM
You can only parse PHP code in files with .php extensions or other extensions designated to be parsed by the PHP parser.

dlsodders
06-10-2004, 04:33 PM
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?

dlsodders
06-10-2004, 05:01 PM
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?

Spookster
06-10-2004, 05:02 PM
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
06-10-2004, 05:04 PM
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.

dlsodders
06-10-2004, 05:05 PM
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.

Nightfire
06-10-2004, 05:08 PM
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

Spookster
06-10-2004, 05:10 PM
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.

dlsodders
06-10-2004, 05:13 PM
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?

dlsodders
06-10-2004, 05:24 PM
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?

Nightfire
06-10-2004, 06:52 PM
faq.php doesn't exist, just go to http://worldofcomputersinc.com/products/hcl/faq/

dlsodders
06-11-2004, 03:58 AM
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.

Nightfire
06-11-2004, 09:51 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum