HTML to PHP
Moderator: General Moderators
HTML to PHP
Is there any effective method or program to covert all your HTML pages to PHP, of should you only use php on the pages that require it ??
Im interested in transfering my site which is http://www.assuredmedical.com to PHP but im not sure it is the best decision. Any pro's and con's would be greatly appreciated.
Thanks
~Snapple
Im interested in transfering my site which is http://www.assuredmedical.com to PHP but im not sure it is the best decision. Any pro's and con's would be greatly appreciated.
Thanks
~Snapple
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
As long as you have PHP on your server, all you need to do is rename the file extension for all of your files to .php from .html and then make sure all of the links are updated to have .php instead of .html.
Yes you can use PHP for just HTML files.
Pro's
More dynamic content (you can do more stuff with PHP and if you have users login then there is a lot more you can do)
Con's
To much codes (PHP ONLY) slow the page down.
Yes you can use PHP for just HTML files.
Pro's
More dynamic content (you can do more stuff with PHP and if you have users login then there is a lot more you can do)
Con's
To much codes (PHP ONLY) slow the page down.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Also for the page: http://www.assuredmedical.com/referral/welcome.html
you could have the users login on a regular page and then only display the content if the session variable login is present or something like that. If you need help feel free to AIM me.
you could have the users login on a regular page and then only display the content if the session variable login is present or something like that. If you need help feel free to AIM me.
The only reason to switch it to php would be if you want to add some sort of dynamic content. Don't switch to php just to have it switched to php... it's not even worth the time. The pro of doing so would be if you wanted to dynamically call the header/menu/footer of your page so that there would be a central place to edit this portions. Just changing your extension to php is pointless.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I'm with Ninja. If you are actually going to use a decent amount of PHP functionality in your site, switch it. But for the sake of serving up pages, leave them static if you do not have a need for dynamic pages.
For me, I did do this with all of my sites. But for me, it was because I moved all my sites to some form of CMS so that I could manage content online rather than having to FTP pages to the server everytime there was a change.
For me, I did do this with all of my sites. But for me, it was because I moved all my sites to some form of CMS so that I could manage content online rather than having to FTP pages to the server everytime there was a change.
That is my main purpose for switching to PHP, im swift in html but a newbie to php and i dont want to get in over my head. but that is what the goal is. any help would be greatly appreciated. I dont use AIM at work but i do have MSN Owen___D@hotmail.comyou could have the users login on a regular page and then only display the content if the session variable login is present or something like that. If you need help feel free to AIM me.
This is also something i was interested in but im unsure of how to make it happen.The only reason to switch it to php would be if you want to add some sort of dynamic content. Don't switch to php just to have it switched to php... it's not even worth the time. The pro of doing so would be if you wanted to dynamically call the header/menu/footer of your page so that there would be a central place to edit this portions. Just changing your extension to php is pointless.
I assume that i would create a PHP script that would have the footer, then call it on to my pages.
Am i in the right ball park here ???
Yes... so it would look something like:
header.inc.php
footer.inc.php
index.php
header.inc.php
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Your page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>Code: Select all
</body>
</html>Code: Select all
<?php
include("header.inc.php");
?>
<!-- Content would go here /-->
<?php
include("footer.inc.php");
?>Moved your sites to some form of CMS??? what is CMS for me that is Center for Medicare Services LOLFor me, I did do this with all of my sites. But for me, it was because I moved all my sites to some form of CMS so that I could manage content online rather than having to FTP pages to the server everytime there was a change.
Yes... so it would look something like:
header.inc.php
php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Your page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
footer.inc.php
php:
</body>
</html>
index.php
php:
<?php
include("header.inc.php");
?>
<!-- Content would go here /-->
<?php
include("footer.inc.php");
?>
So could i use this to call my navagation for my pages? Ie. the links on the bottom of my page or the side???
Also could i make the header.inc.php stright html that will be placed??? or does the header.inc.php have to be coded in php?
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
You are in the parking lot of the ballpark
.
You are going to want to probably (depending on your setup) create a header and footer section. Use them as includes from within the calling PHP page. As a newbie, I would tend to start off with a page, say index.php, that hits the database, grabs some page content or some links or something, then echos them to the screen. Before the echo, include header.php. After the echo, include footer.php.
Header and Footer pages are those parts that are above and below your general page content. These can be static HTML pages or PHP pages, whichever you fancy.
You are going to want to probably (depending on your setup) create a header and footer section. Use them as includes from within the calling PHP page. As a newbie, I would tend to start off with a page, say index.php, that hits the database, grabs some page content or some links or something, then echos them to the screen. Before the echo, include header.php. After the echo, include footer.php.
Header and Footer pages are those parts that are above and below your general page content. These can be static HTML pages or PHP pages, whichever you fancy.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
As a newbie, I would tend to start off with a page, say index.php, that hits the database, grabs some page content or some links or something, then echos them to the screen. Before the echo, include header.php. After the echo, include footer.php.
Thanks so much, its all starting to make sence sorta!
Ive been reading my behind off and i cant seem to find something that makes sense about scripts that query a database. and for that matter what type of database i can use, can i use MS Access??? i understand that you would have to call the field names ie fname or lname email etc... but how to validate them and how to code the php to do these things.