Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: peter20000629

Message # 1015269:
Date: 01/24/03 21:47
By: Liz
Subject: How to Code ASP "Includes" in PHP

I'm used to using ASP includes with that simple reference files in relation to the doc root on my server. Imagine my confusion when I discovered that the PHP "include" and its cousin the "require" functions need a physical path. But I solved the problem.

I develop Web pages using PHP on a Windows machine and upload them to my host's Linux server. I have a simple way that I handle "which way the slashes go." Here's a sample of how I use realpath and the right slashes to include standard footers in my pages.


<?
if (PHP_OS == "WINNT")
{
$slash = "\\";
}
else
{
$slash = "/";
}
$myPath = realpath("common").$slash;

?>

<? require ($myPath."footer.php"); ?>

Previous Message | Next Message


Comments:
RE: How to Link Mysql with vbshyan06/21/05 05:05
PHP to .netAnjali 06/08/05 01:33
RE: How to Link Mysql with vbJayson Guillermo05/01/05 01:42
RE: PHP filesSean Redfearn11/24/04 05:34
Good to see ur siteAbhishek11/06/04 09:07
Rewriting FunctionsManutius12/02/03 03:25
RE: PHP editor for linux?Herman Tolentino05/14/03 11:00
How to Code ASP "Includes" in PHPLiz01/24/03 21:47
conversion of ASP dll's Mike11/05/02 21:24
VB to PHP conversionRussel10/23/02 05:08
PHP editor for linux?rnj10/18/02 22:21
RE: font function not neededMichael08/03/02 20:51
RE: Dangerous people...Scott Carr07/30/02 15:43
RE: Victoria Bitter (VB)Terrent06/25/02 08:36
RE: VB v/s PHPSimone Capra04/21/02 08:29
Patchingcool keith02/24/02 16:27
RE: How to Link Mysql with vbSly02/13/02 10:18
RE: VB v/s PHPRicky Dean01/25/02 02:05
RE: VB/ASP -> PHPRichard Lanham01/21/02 07:39
RE: PHP filesAndy01/16/02 21:54
PHP? VB? Whatever..Jalal Maqdisi01/13/02 09:05
Call to undefined function: mssql_connect() stef11/27/01 07:49
RE: How to Link Mysql with vbd n g11/19/01 03:38
RE: How to Link Mysql with vbLucian11/12/01 07:55
How to Link Mysql with vbImthiaz11/01/01 23:24
RE: PHP and VBchad10/11/01 14:00
i need a code to put one "news.html" in my hphugo10/03/01 12:59
PHP(under Windows) and VBI.Silviu09/16/01 17:31
RE: font function not neededMatt08/17/01 06:44
PHP filesSanchu07/09/01 04:49
font function not neededMark06/23/01 06:59
GREAT!!!Jack Saunders05/09/01 08:43
RE: PHP vs. VBDave05/01/01 05:07
Homesite correctionDaniel Keep04/16/01 04:40
PHP vs. VBGeorge Ob04/10/01 11:00
RE: VB v/s PHPLee04/07/01 10:57
RE: Dangerous people...Charlie03/21/01 14:14
RE: Hardest aspect for meSonOfDad03/09/01 10:16
RE: Victoria Bitter (VB)Devon02/23/01 14:36
RE: Victoria Bitter (VB)Jesus H' Linux01/29/01 12:26
RE: VB v/s PHPJesus H' Linux01/29/01 12:16
RE: Victoria Bitter (VB)Peter Moulding01/11/01 19:22
RE: VB v/s PHPPeter Moulding01/11/01 19:06
RE: Hardest aspect for mePeter Moulding01/11/01 18:51
Hardest aspect for meMike01/10/01 04:54
VB/ASP -> PHPAra01/07/01 02:55
RE: VB v/s PHPDigital Wokan01/02/01 17:51
VB v/s PHPDavid Greene12/28/00 21:58
PHP and VBPeter Dove12/04/00 13:29
RE: Victoria Bitter (VB)Mark Saunders11/16/00 22:41
Victoria Bitter (VB)Louis Zezeran11/02/00 06:35
RE: PHP and VBNeil p Davis10/23/00 12:32
RE: RE: Dangerous people...George Herson07/20/00 22:11
RE: Dangerous people...Tim Perdue, PHPBuilder.com07/13/00 12:03
PHP and VBEdward Brown07/06/00 11:23
Dangerous people...Luis Argerich06/30/00 16:33
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.