What's new

How to convert HTML to PHP? (1 Viewer)

David Baranyi

Stunt Coordinator
Joined
Jul 17, 2003
Messages
81
Good news, I was able to get register another domain name from an accredited registrar (DomainSite.com) and purchased a web hosting package (Future Point, Inc.) outside of FortuneCity. I do not know what is wrong with FortuneCity (I contacted it days ago and yet to receive a response), but it has lost my business. I had demanded a refund. Does anyone know who the registrar FortuneCity is affiliated with?

Anyway, since I now own my domain name, I had been thinking of switching from HTML to PHP. Is there a way to convert my HTML files to PHP?
 

Chris Hovanic

Supporting Actor
Joined
Jan 3, 2003
Messages
545
Might want to bone up on php.... I dont think its a matter of switching from HTML to PHP.

Check out http://www.php.net/ for some info. They have a introductory tutorial that you may want to check out.

Good luck and let us know when your site is up and running!
 

wally

Second Unit
Joined
Feb 12, 2001
Messages
473
PHP is a scripting language. You can place PHP in an HTML document, but it does not replace it.

Good luck!
 

Greg Rowe

Stunt Coordinator
Joined
Nov 29, 2001
Messages
159
Real Name
Greg
:)

As wally said, php is a scripting language. The *output* of your php scripts is usually HTML. See www.php.net for excellent documentation.

Greg
 

Robert Ma

Second Unit
Joined
Jun 18, 2001
Messages
368
I'm a Perl nut myself, PHP's daddy. You want to keep using HTML and then use PHP for database back end or form handling. I believe Wally said that PHP can be in a HTML doc but I do not think that is accurate. JAVA or VBScript yes but if PHP is like perl, it's strickly server side and the browser doesn't have any way running a PHP script.
 

Patrick Larkin

Screenwriter
Joined
May 8, 2001
Messages
1,759
Well, you can send HTML to the browser using PHP like:

PRINT "html code here";

But there really is no point unless you are doing something else with php to warrant its use.
 

nolesrule

Senior HTF Member
Joined
Aug 6, 2001
Messages
3,084
Location
Clearwater, FL
Real Name
Joe Kauffman
PHP can be dropped into an HTML document just like ASP or Cold Fusion, all of which are handled server-side by their engines before being sent through the web server. SO yes, HTML and PHP can be mixed.

Don't confuse server/client-side with how it is parsed serverside.

Just make sure that you use the right file extension so that the web server knows to call the engine first. In the case of PHP, the extension is usually ".php".
 

Robert Ma

Second Unit
Joined
Jun 18, 2001
Messages
368
You can imbed html in php but I still do not get how you imbed php into html. By using the .php extension, the web server will toss the php script to the php engine or isapi filter in MS IIS's case. That is not a html file that is running serverside code. Is there a way to call PHP code imbeded in a html file?
 

Patrick Larkin

Screenwriter
Joined
May 8, 2001
Messages
1,759
So, you want php code to execute within a file with an .html extension? You'd have to set that in your webserver. You tell it what extensions to parse for php code.

For instance, in Apache, you'd enter the following in your config file:

AddType application/x-httpd-php .html

This will result in the php engine parsing every page on your site which depending on your traffic will slow things down.
 

Users who are viewing this thread

Sign up for our newsletter

and receive essential news, curated deals, and much more







You will only receive emails from us. We will never sell or distribute your email address to third party companies at any time.

Forum statistics

Threads
357,005
Messages
5,128,170
Members
144,228
Latest member
CoolMovies
Recent bookmarks
0
Top