473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Get get include pages to work...

Greetings,
I have the following:

require_once($_SERVER["DOCUMENT_ROOT"]."/virtuals/doc-root.php4");

I also have several more include and include once that pull various
sections into my main page. I am trying to get this working on a local
machine for testing purposes. I have (windwos) Apache and PHP set up
on my machine and have written several test pages to confirm things
are working. When I perform an echo of the Document_root and
global_root I get the following:

server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
global doc root:

Anyone have any ideas why I can't using my include/required documents?

TIA for any help

May 17 '07 #1
8 1532
At Thu, 17 May 2007 11:37:35 -0700, dp*****@gmail.com let his monkeys
type:
Greetings,
I have the following:

require_once($_SERVER["DOCUMENT_ROOT"]."/virtuals/doc-root.php4");

I also have several more include and include once that pull various
sections into my main page. I am trying to get this working on a local
machine for testing purposes. I have (windwos) Apache and PHP set up
on my machine and have written several test pages to confirm things
are working. When I perform an echo of the Document_root and
global_root I get the following:

server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
global doc root:

Anyone have any ideas why I can't using my include/required documents?

TIA for any help
I'm not sure about / being valid on windoze. If not, use \\ instead
(easape the \), or use single quotes.
It might be a safe mode restriction, or an open_basedir setting keeping
you from succesfully including.

You should check what errors you get:

start your script with:
error_reporting (E_ALL);
ini_set("display_errors","1");
and see what errors are displayed.

HTH
Sh.
May 17 '07 #2
On May 17, 2:56 pm, Schraalhans Keukenmeester <inva...@invalid.spam>
wrote:
I'm not sure about / being valid on windoze. If not, use \\ instead
(easape the \), or use single quotes.
It might be a safe mode restriction, or an open_basedir setting keeping
you from succesfully including.

You should check what errors you get:

start your script with:
error_reporting (E_ALL);
ini_set("display_errors","1");
and see what errors are displayed.

HTH
Thanks. I tried adding in the error scripting, but I don't seem to see
any errors being generated on the page. I will try switching the
slash, but my newbie question is how would that effect it once I have
loaded to a server?

Thanks again
May 17 '07 #3
At Thu, 17 May 2007 12:03:59 -0700, dp*****@gmail.com let his monkeys
type:
On May 17, 2:56 pm, Schraalhans Keukenmeester <inva...@invalid.spam>
wrote:
>
I'm not sure about / being valid on windoze. If not, use \\ instead
(easape the \), or use single quotes.
It might be a safe mode restriction, or an open_basedir setting keeping
you from succesfully including.

You should check what errors you get:

start your script with:
error_reporting (E_ALL);
ini_set("display_errors","1");
and see what errors are displayed.

HTH

Thanks. I tried adding in the error scripting, but I don't seem to see
any errors being generated on the page. I will try switching the
slash, but my newbie question is how would that effect it once I have
loaded to a server?

Thanks again
As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
php manual for that. But since you get no errors it seems fine.

If you upload it to a non-windows server you'd always have to use \ afaik.

But, not getting any errors at all with above additions? Hmm, that might
indicate the files are properly required/included after all.
Can you show a relevant snippet of your working code?
If you echo a string following the require, does that display properly?

Sh.
May 17 '07 #4
On May 17, 3:17 pm, Schraalhans Keukenmeester <inva...@invalid.spam>
wrote:
As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
php manual for that. But since you get no errors it seems fine.

If you upload it to a non-windows server you'd always have to use \ afaik.

But, not getting any errors at all with above additions? Hmm, that might
indicate the files are properly required/included after all.
Can you show a relevant snippet of your working code?
If you echo a string following the require, does that display properly?

Sh
I tried the echo (you will see it in the code below) but it did not
display on the screen. I am really new to PHP, so there is a good
possibility I am doing something wrong...

<?
$updated = "4/3/07";
//$_SERVER["DOCUMENT_ROOT"] = str_replace( $_SERVER["PATH_INFO"],

//"", ereg_replace( "[\][\]", "/", $_SERVER["PATH_TRANSLATED"] )

//)."/";

require_once("virtuals/doc-root.php4");
echo "test";

?>
<html>
<head>
<?

include_once($_SERVER["DOCUMENT_ROOT"]."/virtuals/header-
script.php4");

?>

<?

include_once($_SERVER["DOCUMENT_ROOT"]."/virtuals/header-home.php4");

?>

I will check the docs to see if windows will support both slashes
May 17 '07 #5
dp*****@gmail.com wrote:
On May 17, 3:17 pm, Schraalhans Keukenmeester <inva...@invalid.spam>
wrote:
>As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
php manual for that. But since you get no errors it seems fine.

If you upload it to a non-windows server you'd always have to use \ afaik.

But, not getting any errors at all with above additions? Hmm, that might
indicate the files are properly required/included after all.
Can you show a relevant snippet of your working code?
If you echo a string following the require, does that display properly?

Sh

I tried the echo (you will see it in the code below) but it did not
display on the screen. I am really new to PHP, so there is a good
possibility I am doing something wrong...

[skip]

I will check the docs to see if windows will support both slashes

Forward slash ( / ) works perfectly on WIndows systems and it is the one
you must use in your 'include' and 'require' statements.

If you're just starting with php, I'd suggest you get one of
pre-packaged windows installations (e.g.
http://www.apachefriends.org/en/xampp.html) and let it setup everything
for you.
--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 17 '07 #6
Schraalhans Keukenmeester wrote:
At Thu, 17 May 2007 11:37:35 -0700, dp*****@gmail.com let his monkeys
type:
>Greetings,
I have the following:

require_once($_SERVER["DOCUMENT_ROOT"]."/virtuals/doc-root.php4");

I also have several more include and include once that pull various
sections into my main page. I am trying to get this working on a local
machine for testing purposes. I have (windwos) Apache and PHP set up
on my machine and have written several test pages to confirm things
are working. When I perform an echo of the Document_root and
global_root I get the following:

server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
global doc root:

Anyone have any ideas why I can't using my include/required documents?

TIA for any help

I'm not sure about / being valid on windoze. If not, use \\ instead
(easape the \), or use single quotes.
It might be a safe mode restriction, or an open_basedir setting keeping
you from succesfully including.

You should check what errors you get:

start your script with:
error_reporting (E_ALL);
ini_set("display_errors","1");
and see what errors are displayed.

HTH
Sh.
Schraalhans,

'/' is perfectly good in windows. Perhaps its' the spaces in your paths?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 18 '07 #7
"/" is working fine in windows. please send the code and before check
that there is any spaces in between /s

May 18 '07 #8
Schraalhans Keukenmeester wrote:
I'm not sure about / being valid on windoze. If not, use \\ instead
(easape the \), or use single quotes.
'/' has been a valid file separator since DOS 2.x IIRC. Certain DOS and
Windows *programs* don't recognise it, but the OS kernel itself does.

(Annoyingly COMMAND.COM is/was one of those programs that didn't recognise
it!)

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 18 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg | last post by:
I'm new to html and web coding, this is a simple one - appreciate your help! I'm attempting to get my browser bar links to reside in a single .asp file to avoid multiple additions to pages when...
5
by: cooldv | last post by:
i have many *.html* pages with the same header. i wanted to make one *header* file and put a link to that file in all html pages. So if i ever need to make changes in the header, i will need to...
10
by: EnjoyNews | last post by:
I have a php site I have an include line called "include 'Cookie.php';" In this Cookie.php file I have these codes. <?php $conn = mysql_connect("$db", "$user", "$pass");...
2
by: Kraai | last post by:
in normal asp , and even php i could use the <!--#include file="login.aspx" --> or <!--#include virtual="login.aspx" --> to include pages in my main page without using frames! when i try...
3
by: Tams TS | last post by:
Hi, am in trouble , please giv me some solution. scenario is like this; I have some asp pages and which are commerce server 2000 generated pages and going further am adding one aspx page to the...
2
by: WisTex | last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even...
23
by: Big Bill | last post by:
http://www.promcars.co.uk/pages/bonnie.php I don't believe they should be there, can I take them out without stopping the includes from functioning? I'm the (hapless) optimiser on this one... I...
14
by: Julesh | last post by:
Hello, I am new to ASP and am trying to make some changes to some ASP 3.0 code I have inherited. I have a number of ASP pages with VBS as the base language, on each of these pages I have...
2
by: William van Zwanenberg | last post by:
Hi there, I wonder if you guys can help. I'm currently experiencing some coding problems what with trying to use PHP and javascript in tandem. What I'm ultimately trying to achieve is use...
25
by: Mark | last post by:
so, i'm making a website. let's say i have header.php, footer.php and content.php. now in index.php I simply want to include the 3 pages. easy enough to do. but let's say the user navigates to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.