Professional Web Applications Themes

Problem with Apache 1.3.28/PHP 4.3.3 on XP - PHP Development

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 ...

  1. #1

    Default 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 :

    [url]http://127.0.0.1/gallery/canada_0303/imgquery.php?PID=F1P02&mode=Photo[/url]

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

    [url]http://127.0.0.1/gallery/canada_0303/imgquery.php[/url]

    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 :

    [url]http://www.novaldex.com/gallery/canada_0303/imgquery.php[/url]

    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;
    cht=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.
    Nick Rees Guest

  2. #2

    Default Re: Problem with Apache 1.3.28/PHP 4.3.3 on XP

    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 :
    >
    > [url]http://127.0.0.1/gallery/canada_0303/imgquery.php?PID=F1P02&mode=Photo[/url]
    >
    > I still get the same result as if i'd typed in :
    >
    > [url]http://127.0.0.1/gallery/canada_0303/imgquery.php[/url]
    >
    > 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 :
    >
    > [url]http://www.novaldex.com/gallery/canada_0303/imgquery.php[/url]
    >
    > 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;
    > cht=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:
    [url]http://fr2.php.net/manual/en/language.variables.predefined.php[/url]

    fred.

    FredBriand Guest

  3. #3

    Default Re: Problem with Apache 1.3.28/PHP 4.3.3 on XP

    FredBriand <ZYXfredbriandXYZZXYblueboxstudioXYZ.net> wrote in message news:<bk17nj$u4g$1news-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:
    > [url]http://fr2.php.net/manual/en/language.variables.predefined.php[/url]
    >
    > 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.
    Nick Rees Guest

Similar Threads

  1. Problem after an upgrade to php 5.0.1 and Apache 1.3.31
    By NothingHere in forum PHP Development
    Replies: 7
    Last Post: September 14th, 01:19 PM
  2. OS X, Apache, PHP -- configuration problem
    By J.B. Moreno in forum PHP Development
    Replies: 2
    Last Post: January 2nd, 10:51 AM
  3. Apache 1.3 config problem
    By Robert J Taylor in forum PERL Beginners
    Replies: 3
    Last Post: September 17th, 10:01 PM
  4. Replies: 2
    Last Post: July 27th, 05:29 PM
  5. Replies: 2
    Last Post: July 17th, 07:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139