473,326 Members | 1,972 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,326 software developers and data experts.

Problem running PHP on localhost

I have installed Apache and PHP (and MySQL) on my own computer so that I can
test
out my scripts without having to keep uploading them to my ISP.
I have created a very simple php script (below) just to test out my set-up.
This works fine when I upload it to the server at my ISP (when I type
something
in the box, it is displayed back to me) but when I run it on my own system,
I get nothing. I can see the value in the querystring in the address bar of
my browser, but the $eek variable does not seem to be being set. Is there
something I need to enable in PHP or Apache to make this work?
TIA
Phil.

<HTML>
<BODY>
<?php
echo $eek;
?>
<FORM>
<INPUT name=eek>
</FORM>
</BODY>
</HTML>


Jun 12 '07 #1
2 1413

"Phil Preen" <n/awrote in message
news:46**********************@ptn-nntp-reader02.plus.net...
>I have installed Apache and PHP (and MySQL) on my own computer so that I
can test
out my scripts without having to keep uploading them to my ISP.
I have created a very simple php script (below) just to test out my
set-up.
This works fine when I upload it to the server at my ISP (when I type
something
in the box, it is displayed back to me) but when I run it on my own
system,
I get nothing. I can see the value in the querystring in the address bar
of
my browser, but the $eek variable does not seem to be being set. Is there
something I need to enable in PHP or Apache to make this work?

Found it. I needed to set register_globals=on in php.ini
Jun 12 '07 #2
Phil Preen wrote:
>
"Phil Preen" <n/awrote in message
news:46**********************@ptn-nntp-reader02.plus.net...
I have installed Apache and PHP (and MySQL) on my own computer so
that I can test out my scripts without having to keep uploading
them to my ISP. I have created a very simple php script (below)
just to test out my set-up. This works fine when I upload it to
the server at my ISP (when I type something in the box, it is
displayed back to me) but when I run it on my own system, I get
nothing. I can see the value in the querystring in the address bar
of my browser, but the $eek variable does not seem to be being set.
Is there something I need to enable in PHP or Apache to make this
work?

Found it. I needed to set register_globals=on in php.ini
The requirement of register_globals being on is just a result of bad
programming practices, really. You should make an effort to use the
$_POST and $_GET arrays instead, based on the request method ("post" or
"get"). In a pinch, use the $_REQUEST array, but please note that this
also contains the elements from $_COOKIE as well (HTTP cookies).

As for server variables, use $_SERVER instead.

PHP manual: Using Register Globals:
http://www.php.net/manual/en/security.globals.php

--
Kim André Akerø
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Jun 12 '07 #3

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

Similar topics

0
by: Smita | last post by:
hello ! > > > I am trying to intstall Mysql binary version with installor in Windows > XP machine . But it is not working . i have installed in the default > path ,in windows service componenet...
7
by: Jacob | last post by:
Has anybody else encountered a problem when running your asp.net applications off your localhost and having broken image links? The weird thing is, the links aren't really broken. The reference...
8
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set...
2
by: Richard Lionheart | last post by:
Hi All, I generated a WebForm and created a Virtual Directory for it IIS. But I got an error message (shown below) saying something like my app lacked appropriate privileges. David Wang...
2
by: Steve Gollery | last post by:
I installed Postgres 8 beta 3 on an XP box, with Postgres running as a service. TaskManager tells me that postgres and postmaster are both running. Using pgAdmin III, I can connect to the server...
3
by: Ron L | last post by:
I have an application that I am working on with 2 other developers. The applciation uses Remoting for our calls to SQL Server. We have been developing and testing against our development machines...
2
by: tshad | last post by:
I am trying to use my IIS web server on my local machine for testing my web site. The problem is that periodically it will not use the virtual directory for the root. This happens for my...
10
by: TS | last post by:
i just noticed the website i created in VS 2005 is running on a different port than the default. I see that it is running on the local web server, and also that the website i created isn't in IIS....
8
by: geert | last post by:
Hi all, I have a mac mini running maocosx 10.5 leopard I want to deploy a django project on. My backend is MySQL, and I have it running as a 64- bit app. Of course, apache2 is also running as...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: 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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.