I installed IIS, PHP and MySQL on my windows XP machine. I am able ot get scripts like "Hello World!" to work but when I try to pass data with Get and Post the receiving psp scripts do not see the data.

I have tried http://localhost/Winestore/example.5-2.php?regionName=all but the the var regionName is not sent to the receiving script.

Any help here?

I have gone into the IIS and added php to the ISAPI filters. It shows that the status is not loaded. I set it to c:\php\php4ts.dll.

Surely somebody is using IIS with php on a home system running xp out there.

Any help would be GREATLY appreciated!

TIA.

Frank

    It doesn't set $regionName, it set $_GET['regionName'].

      Can you post your code - or give this a try:

      <?php
      	echo 'Hello...<br>';
      	echo "regionName in a string = $_GET[regionName]<br>";
      	echo 'regionName outside string = '.$_GET['regionName'];
      ?>

      Just in case you didn't know about the not needing single quotes about the variable index inside double quotes I've done it both ways.

      Run it with something like

      http://localhost/Php/get-test.php?regionName=you%20alright,%20Jean?%20%20Legs%20been%20playin'%20you%20up%20lately?

        print_r($_GET);
        

        would seem like the thing to do to me 😉

          Here is examp 5.2 which is supposed to send a regionName.

          <?
          /*
          Source code example for Web Database Applications

          Unless otherwise stated, the source code distributed with this book can be
          redistributed in source or binary form so long as an acknowledgment appears
          in derived source files.
          The citation should list that the code comes from Hugh E.
          Williams and David Lane, "Web Database Application with PHP and MySQL"
          published by O'Reilly & Associates.
          This code is under copyright and cannot be included in any other book,
          publication, or educational product without permission from O'Reilly &
          Associates.
          No warranty is attached; we cannot take responsibility for errors or fitness
          for use.
          */
          ?>
          <!DOCTYPE HTML PUBLIC
          "-//W3C//DTD HTML 4.0 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>Explore Wines in a Region</title>
          </head>
          <body bgcolor="white">
          <form action="example.5-1.php" method="POST">
          <br>Enter a region to browse :
          <input type="text" name="regionName" value="All">
          (type All to see all regions)
          <br>
          <input type="submit" value="Show wines">
          </form><br>
          <a href="index.html">Home</a>
          </body>
          </html>


          Here is examp 5-1 which is called.

          ?
          /*
          Source code example for Web Database Applications

          Unless otherwise stated, the source code distributed with this book can be
          redistributed in source or binary form so long as an acknowledgment appears
          in derived source files.
          The citation should list that the code comes from Hugh E.
          Williams and David Lane, "Web Database Application with PHP and MySQL"
          published by O'Reilly & Associates.
          This code is under copyright and cannot be included in any other book,
          publication, or educational product without permission from O'Reilly &
          Associates.
          No warranty is attached; we cannot take responsibility for errors or fitness
          for use.
          */
          ?>
          <!DOCTYPE HTML PUBLIC
          "-//W3C//DTD HTML 4.0 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>Parameter</title>
          </head>
          <body>
          <?php

          echo "RegionName is " . .$regionName . "\n";
          ?>
          </body>
          </html>

          When I run the above example all I get is an error that var regionName

          Undefined variable: regionName in c:\inetpub\wwwroot\Winestore\example.5-1.php

            The script is expecting you to have register_globals on, so I suggest you ignore that fact and change it to $_GET['regionName'], but you said that didn't work (but alas, that's a different problem)...

              OK,

              I put this line in:

              echo "RegionName is " . $_GET[regionName] . "\n";

              Now I get:

              Notice: Use of undefined constant regionName - assumed 'regionName' in c:\inetpub\wwwroot\Winestore\example.5-1.php on line 29
              RegionName is Riverland

              This newbie is confused.

              How do I turn register-globals on?

              In the Php.ini?

              Whatever I need to do I will do.

              🙁

                Had to put quotes around the var:

                echo "RegionName is " . $_GET['regionName'] . "\n";

                Thanks you for your help!

                🙂 🙂

                  Write a Reply...