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

Problem with Apache 1.3.28/PHP 4.3.3 on XP

Hi,

I've got a strange query that I can't figure out. I've got a new
installation of Apache 1.3.28 and PHP 4.3.3 on my laptop, but it
doesn't appear to be processing URLs correctly. I've tried to do a
direct copy of my config on my desktop (which is Apache 1.3.27 and PHP
4.3.1, I think), but I don't have access to it any more to check the
config files.

Apache works fine, I installed it first and tested it with several
pages. They all get served nicely.

PHP itself works fine, it processes and serves files correctly, with
only one apparent problem.

If you pass a URL such as :

http://127.0.0.1/gallery/canada_0303...P02&mode=Photo

I still get the same result as if i'd typed in :

http://127.0.0.1/gallery/canada_0303/imgquery.php

I added a line to print out the variables at the top of the page, and
all of them are empty. Regardless of what you put in.

If you need an example :

http://www.novaldex.com/gallery/cana...3/imgquery.php

this is the same file (with only mods for usernames/passwords for
different servers) and it works perfectly on my webhost. Click on the
'Next' and 'Prev' photos on the right to scroll through the pictures.

Here is the primary code that is of concern :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Image Viewer</title>
<base target="_self">
</head>

<body bgcolor="#000000" text="#0080FF" topmargin="5" leftmargin="5">

<table border="0" width="100%">
<?php

// Connect to the local server
$dbcnx = @mysql_connect("localhost", "Visitor", "galleryvisitor");
if (!$dbcnx)
{
echo( "<p>Database server unavailable<p>" );
exit();
}

// Connect to the Gallery database
if (! @mysql_select_db("gallery", $dbcnx) )
{
echo( "<p>Unable to access The Gallery database<p>" );
exit();
}

// test for optional selections
$query_str = "";
if ($PID != NULL)
{
$query_str = " WHERE PID LIKE \"" . $PID . "\"";
}

echo("<p>Query string '1' is : \"" . $query_str . "\" ¦ PID : \"" .
$PID . "\" ¦ Mode : \"" . $Mode . "\"<p>");

if ($PID == NULL)
{
$mode = "Photo";
$query_str = " WHERE PID LIKE \"F1P01\"";
}

$result = @mysql_query("SELECT * FROM canada_0303" . $query_str);
if (!$result)
{
echo("<p>Query for image data failed : " . mysql_error() . "<p>");
exit();
}

Does anyone have any suggestions or questions? I've tried these files
in both Mozilla and IE, and they both produce the same results.

Many thanks in advance.

Nick.
Jul 16 '05 #1
2 1904
Nick Rees a écrit :
Hi,

I've got a strange query that I can't figure out. I've got a new
installation of Apache 1.3.28 and PHP 4.3.3 on my laptop, but it
doesn't appear to be processing URLs correctly. I've tried to do a
direct copy of my config on my desktop (which is Apache 1.3.27 and PHP
4.3.1, I think), but I don't have access to it any more to check the
config files.

Apache works fine, I installed it first and tested it with several
pages. They all get served nicely.

PHP itself works fine, it processes and serves files correctly, with
only one apparent problem.

If you pass a URL such as :

http://127.0.0.1/gallery/canada_0303...P02&mode=Photo

I still get the same result as if i'd typed in :

http://127.0.0.1/gallery/canada_0303/imgquery.php

I added a line to print out the variables at the top of the page, and
all of them are empty. Regardless of what you put in.

If you need an example :

http://www.novaldex.com/gallery/cana...3/imgquery.php

this is the same file (with only mods for usernames/passwords for
different servers) and it works perfectly on my webhost. Click on the
'Next' and 'Prev' photos on the right to scroll through the pictures.

Here is the primary code that is of concern :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Image Viewer</title>
<base target="_self">
</head>

<body bgcolor="#000000" text="#0080FF" topmargin="5" leftmargin="5">

<table border="0" width="100%">
<?php

// Connect to the local server
$dbcnx = @mysql_connect("localhost", "Visitor", "galleryvisitor");
if (!$dbcnx)
{
echo( "<p>Database server unavailable<p>" );
exit();
}

// Connect to the Gallery database
if (! @mysql_select_db("gallery", $dbcnx) )
{
echo( "<p>Unable to access The Gallery database<p>" );
exit();
}

// test for optional selections
$query_str = "";
if ($PID != NULL)
{
$query_str = " WHERE PID LIKE \"" . $PID . "\"";
}

echo("<p>Query string '1' is : \"" . $query_str . "\" ¦ PID : \"" .
$PID . "\" ¦ Mode : \"" . $Mode . "\"<p>");

if ($PID == NULL)
{
$mode = "Photo";
$query_str = " WHERE PID LIKE \"F1P01\"";
}

$result = @mysql_query("SELECT * FROM canada_0303" . $query_str);
if (!$result)
{
echo("<p>Query for image data failed : " . mysql_error() . "<p>");
exit();
}

Does anyone have any suggestions or questions? I've tried these files
in both Mozilla and IE, and they both produce the same results.

Many thanks in advance.

Nick.

The problem comes from the fact that environment variables and so on are
no longer global variables by default. In order to get the value of a
"get" variable, you must type:
$query_str = " WHERE PID LIKE \"" . $_GET["PID"] . "\"";

Same for "post", "server", "session"...

Check the doc for the whole thing:
http://fr2.php.net/manual/en/languag...predefined.php

fred.

Jul 16 '05 #2
FredBriand <ZY**************@ZXYblueboxstudioXYZ.net> wrote in message news:<bk**********@news-reader1.wanadoo.fr>...
The problem comes from the fact that environment variables and so on are

no longer global variables by default. In order to get the value of a
"get" variable, you must type:
$query str = " WHERE PID LIKE \"" . $ GET["PID"] . "\"";

Same for "post", "server", "session"...

Check the doc for the whole thing:
http://fr2.php.net/manual/en/languag...predefined.php

fred.


Hi Fred, thanks for your post.

Modified my code as you described above (but needed to change that '$
GET' to '$_GET') and it worked a treat.

Can't quite figure out why it worked perfectly well on my desktop and
my domain though . . . must be a setting somewhere in the .ini/config
files. I'll make the necessary modifications and reload all the pages.

Thanks for your help!

Nick.
Jul 16 '05 #3

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

Similar topics

0
by: wai | last post by:
hi all, i running cocoon 2.1.1 with websphere 5, i have a problem related to xsp cinclude. everything after my first cinclude statement, it become bank. i been tested the cocoon cinclude...
0
by: Brian | last post by:
I am having alot of trouble getting a XML document validated with a schema. I got a sample document and schema off of w3schools.com, which passed an online xml validator:...
0
by: zhenya.tkachenko | last post by:
Hi! Have a problem with mod_auth_mysql. Compilation and installation of module done ok: # /usr/local/apache/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz...
10
by: sssk28 | last post by:
i have installed fedora core 6 and i am getting following error: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this...
3
by: IamtheEvster | last post by:
Hi there, I'm using fopen for the first time and I know I'm running into a permissions problem, but I can't seem to resolve it and any help would be greatly appreciated. I'm running PHP5 and...
0
by: osa | last post by:
I have a problem with commons-httpclient-3.1. When i try to get some page, cookies do not come to me. There is no error or exception message. Just null text. What could you advise me? Code:...
0
rsrinivasan
by: rsrinivasan | last post by:
Hi All, When i run my JSP program, ihave the following exception. How i solve this problem? HTTP Status 500 - ...
0
by: shaileshkumar | last post by:
hi, iam unable to run my applications in netbeans4.1. problem may be due to JVM or port numbers conflict. i did not intentionally change any port numbers . please guide me accordingly. iam...
1
by: sethupnr | last post by:
when i'm using a simple JSP-mysql code it shows some HTTP status 500 error.But simple JSP program without databse is running , Please help how to solve this problem. I'm new to JSP. my...
3
dmjpro
by: dmjpro | last post by:
Have a look at my problem. try{ //String tokenLocatorUrl = "http://erp.iitkgp.ernet.in:80/SSO_Token_Object_locator/resources/getSSOToken"; String tokenLocatorUrl...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.