473,287 Members | 1,927 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,287 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 1965

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.