473,405 Members | 2,421 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.

Lost novice

Ewa
Hello

I have inherited a www service after someone, I have problems with PHP
parts. As I am complete novice. I will be very greatful for your help - I
did not managed to find an answer myself. My questions are trivial, I guess.

The service is now being moved to another server (PHP 4) and also I would
like to run it on my local WAMP (PHP 5) for tests.

1. There's a directory defined there called php_base, which is the root
directory of this service. All other file locations are definded as
$php_base/file. Unluckily php_base is absolute, so I need to change it
manually each time I want to use other server. Is there a way to make it
server-indpendent? I found that on my WAMP the default location is service
root, so I can simply use paths relative service root. However, I guess it
did not work this way on the old server, because the absolute path has been
specified. Could you show me a proper way of doing it?

2. Some php pages take a parameter, that is specified in the URL referencing
this page.
http://localhost/mypage.php?mypar=value
In the page body the parameter is referenced as $mypar. Unluckily for some
reason on my WAMP it is always seen as empty, no matter with what value I
open the page. I am helpless and could not find any indication in php
manual.

Many thanks for your help,

Ewa

Jul 17 '05 #1
2 1973

Ewa wrote:
Hello

I have inherited a www service after someone, I have problems with PHP parts. As I am complete novice. I will be very greatful for your help - I did not managed to find an answer myself. My questions are trivial, I guess.
The service is now being moved to another server (PHP 4) and also I would like to run it on my local WAMP (PHP 5) for tests.

1. There's a directory defined there called php_base, which is the root directory of this service. All other file locations are definded as
$php_base/file. Unluckily php_base is absolute, so I need to change it manually each time I want to use other server. Is there a way to make it server-indpendent? I found that on my WAMP the default location is service root, so I can simply use paths relative service root. However, I guess it did not work this way on the old server, because the absolute path has been specified. Could you show me a proper way of doing it?

2. Some php pages take a parameter, that is specified in the URL referencing this page.
http://localhost/mypage.php?mypar=value
In the page body the parameter is referenced as $mypar. Unluckily for some reason on my WAMP it is always seen as empty, no matter with what value I open the page. I am helpless and could not find any indication in php
manual.

Many thanks for your help,

Ewa

1. as far as i can see, $php_base is a variable that must be defined
somewhere, but always has the same value. include, or better require,
some config file at the top of each script where you define your base
path, so you have to change only one setting every time the value
changes.

2. i think register_globals is set to off on your WAMP(check with
php_info), which means ?mypar=value is not automatically registered as
$mypar=value. register globals off is good, so don't change the
setting.
?mypar=value becomes $_GET['mypar']= value on your system. you could
use some editor that supports search/replace over many files to adapt
your code (i use proton for that - www.meybohm.de - but i don't know if
an english version is available).

micha

Jul 17 '05 #2
i use this:

require $_SERVER['DOCUMENT_ROOT'].'/config.php';

you just have to put your config file in the doc root.

micha

Jul 17 '05 #3

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

Similar topics

5
by: Marian | last post by:
Hi, I am totaly novice in .NET and I am studying a book about this. There was mentioned "assembly". I did not understand, how function does it has . I would like to know the exact run of code...
0
by: Christophe Poirier | last post by:
------=_NextPart_000_0023_01C35B54.206CFD60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I am working on a Windows 2000 server. The version 4.0.13 was...
4
by: Tim Bird | last post by:
Hi all. I have recently installed VB2005 so teach myself programming, could anyone suggest any links to useful websites, or help sites, Ideally I am looking for tutorials, written for the...
1
by: gretchen.ogrady | last post by:
I admit - I'm a simple user but looking to improve skills. Instructions aren't helping and have searched this group but am getting bogged down by some of the programming-speak. I have a query...
4
by: trond | last post by:
Hello all, Before I start I'd like to point out that I am a complete novice when it comes to asp.net - My background is in network and operating systems, and although I have been doing a bit of...
7
by: Erik | last post by:
I have an application that uses sessions variables a lot but one I publish the application on the prod server these variables are lost. The application is written i c# 2.0 and I've set the...
2
by: maxkumar | last post by:
Hi, I am running a ASP.NET 1.1 site on Win Server 2003 with IIS 6.0. The website has been running for about 1.5 years now. In the past, we used to have random cases of session variables getting...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
5
by: =?ISO-8859-2?Q?Istv=E1n?= | last post by:
Could somebody suggest me a novice Python list, please? Thanks, Istvan
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.