Real Estate Forums
| Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here. |
![]() |
|
|
Thread Tools | Display Modes |
|
||||
|
hi folks,
I am slowly converting my site to use .php pages. It is currently using includes and .shtml and .html pages. What is the code for the following include coverted to a php include? <!--#include virtual="/my-directory/mypage-to-be-included.html"-->
__________________
Kind regards, Capt. Mike Foate - By Land or By Sea! Panama City Beach Real Estate-Homes and Condos For Sale GOT FISH? SEE FISH? CAPT. MIKE'S CELL: 850-596-4236 Capt. Mike Foate-REALTOR® Prudential Shimmering Sands Realty 400 S. Hwy 79 Panama City Beach, FL 32413 |
|
||||
|
I think include_once() may be a better option, IIRC if the resource is not found using require_once() or require() it may throw an error and not render the rest of the page.
__________________
Michael Krotchie - REALTOR® - Coldwell Banker Residential Brokerage, NRT LLC 6970 N. Oracle Road, Suite 100 Tucson, AZ 85704 520.404.4996 -- Mobile 520.544.4545 -- Office Tucson Real Estate | Tucson Real Estate Blog |
|
||||
|
geez you guys are quick! I guess I'll wait until the dust settles because we got differing opinions... ;-)
Is ok to include .html pages in a .php page? Kind regards, Capt. Mike |
|
||||
|
That is correct, you'll get a error if your path is named wrong.
|
|
||||
|
I put up a couple example pages to show the difference; and yes, it is okay to include .html pages in a .php page... I do it all the time.
Example using require_once() www (dot) michaelkrotchie.com/require_once.php Code:
<?php
require_once("nothere.html");
?>
www (dot) michaelkrotchie.com/include_once.php Code:
<?php
include_once("nothere.html");
?>
__________________
Michael Krotchie - REALTOR® - Coldwell Banker Residential Brokerage, NRT LLC 6970 N. Oracle Road, Suite 100 Tucson, AZ 85704 520.404.4996 -- Mobile 520.544.4545 -- Office Tucson Real Estate | Tucson Real Estate Blog Last edited by mkrotchie; 06-01-2007 at 01:33 PM. Reason: not sure if I am allowed to direct link to my site.. subsituted (dot) |
|
||||
|
Heck you guys are GREAT! :-)
Thanks for your help! Now I gotta figure out how to slowly migrate the pages with the extensions changed from .shtml to .php and not get dinged too bad in the search engines. I suppose I should research and see if there is some sort of mod rewrite solution... Thanks you guys! Have a GREAT weekend! Kind regards, Capt. Mike Last edited by Capt. Mike; 06-01-2007 at 02:00 PM. |
|
|||
|
Here is some code you can play with. Place it in a page, then call up that page in a browsers something like this -www.your-domain.com/your_page.php/1/2/3/4/5/6 and you will see how it works. I put a few "echos" in there so you can see waht it does. Change the browser url to www.your-domain.com/your_page.php/6/5/4/3/2/1 and you'll see it.
I've used that system quite a bit and have good luck with it. SE friendly urls - http://www.sitepoint.com/article/sea...riendly-urls/2 Here's the code <? $file=eregi_replace($_SERVER['SERVER_NAME'], "", $_SERVER['PHP_SELF']); $var=explode("/", $file); $affiliate_num_test = $var[3] ;//repnaming header_ID echo '$affiliate_num_test = ', $affiliate_num_test;?><BR><? $url_cat = $var[4] ; echo '$url_cat = ', $url_cat;?><BR><? $cat_record_num = $var[5] ; $cat_page_total = $var[6] ; $cat_page_id = $var[7] ; $link_page_id = $var[8] ; $link_page_total = $var[9] ; $link_record_num = $var[10] ; echo 'link_record_num = ', link_record_num;?><BR><? include("http://Bungeebones.com/link_exchange/index.php/$affiliate_num/$url_cat/$cat_record_num/$cat_page_total/$cat_page_id/$link_page_id/$link_page_total/$link_record_num"); |
![]() |
| Thread Tools | |
| Display Modes | |
|
|