PHP and Apache confi problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krista

    PHP and Apache confi problem

    Hi everybody,
    I think my confi has some problems. Can you guys help me to see what is going on?

    i install Apache2.0.48 and Php4.3.4 in WinXP.
    I add some codes in httpd(inside apache group/apache2)

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe"

    # For PHP 4 do something like this:
    LoadModule php4_module "c:/php/sapi/php4apache2.dll "
    AddType application/x-httpd-php .php

    In addition, I put the php.ini file in Windows, put
    php4ts.dll in system32. Anything else?
    When I run apache and write some php code, I cannot
    pass agrument between two php files. Do you guys have any idea?
    Thanks.

    Krista
  • SwissCheese

    #2
    Re: PHP and Apache confi problem

    "Krista" <ywan_ip@hotmai l.com> wrote in message
    news:eb97c972.0 312051053.d18c5 f3@posting.goog le.com...[color=blue]
    > Hi everybody,
    > I think my confi has some problems. Can you guys help me to see what is[/color]
    going on?[color=blue]
    >
    > i install Apache2.0.48 and Php4.3.4 in WinXP.
    > I add some codes in httpd(inside apache group/apache2)
    >
    > ScriptAlias /php/ "c:/php/"
    > AddType application/x-httpd-php .php
    > Action application/x-httpd-php "/php/php.exe"
    >
    > # For PHP 4 do something like this:
    > LoadModule php4_module "c:/php/sapi/php4apache2.dll "
    > AddType application/x-httpd-php .php
    >
    > In addition, I put the php.ini file in Windows, put
    > php4ts.dll in system32. Anything else?
    > When I run apache and write some php code, I cannot
    > pass agrument between two php files. Do you guys have any idea?
    > Thanks.
    >
    > Krista
    >[/color]

    page1 sends:

    www.mysite.com/page2.php?var1= "something"&var 2="somethingels e"

    page2 reads:

    $var1 = $_GET["var1"]; // or $_PUT[]
    $var2 = $_GET["var2"]; // or $_PUT[]

    or just use $_GET[] or $_PUT[] throughout your script


    Comment

    • Krista

      #3
      Re: PHP and Apache confi problem

      "SwissChees e" <SwissCheese@cf l.rr.com> wrote in message news:<airAb.306 56$%h4.12745@tw ister.tampabay. rr.com>...[color=blue]
      > "Krista" <ywan_ip@hotmai l.com> wrote in message
      > news:eb97c972.0 312051053.d18c5 f3@posting.goog le.com...[color=green]
      > > Hi everybody,
      > > I think my confi has some problems. Can you guys help me to see what is[/color]
      > going on?[color=green]
      > >
      > > i install Apache2.0.48 and Php4.3.4 in WinXP.
      > > I add some codes in httpd(inside apache group/apache2)
      > >
      > > ScriptAlias /php/ "c:/php/"
      > > AddType application/x-httpd-php .php
      > > Action application/x-httpd-php "/php/php.exe"
      > >
      > > # For PHP 4 do something like this:
      > > LoadModule php4_module "c:/php/sapi/php4apache2.dll "
      > > AddType application/x-httpd-php .php
      > >
      > > In addition, I put the php.ini file in Windows, put
      > > php4ts.dll in system32. Anything else?
      > > When I run apache and write some php code, I cannot
      > > pass agrument between two php files. Do you guys have any idea?
      > > Thanks.
      > >
      > > Krista
      > >[/color]
      >
      > page1 sends:
      >
      > www.mysite.com/page2.php?var1= "something"&var 2="somethingels e"
      >
      > page2 reads:
      >
      > $var1 = $_GET["var1"]; // or $_PUT[]
      > $var2 = $_GET["var2"]; // or $_PUT[]
      >
      > or just use $_GET[] or $_PUT[] throughout your script[/color]

      I don't understand. For example, my script is to ask a user to enter
      his/her name and click enter button. The following page should print
      the user's name. However, I don't know why I cannot pass the name in
      next page. Is it the config problem?

      Comment

      • Krista

        #4
        Re: PHP and Apache confi problem

        "SwissChees e" <SwissCheese@cf l.rr.com> wrote in message news:<airAb.306 56$%h4.12745@tw ister.tampabay. rr.com>...[color=blue]
        > "Krista" <ywan_ip@hotmai l.com> wrote in message
        > news:eb97c972.0 312051053.d18c5 f3@posting.goog le.com...[color=green]
        > > Hi everybody,
        > > I think my confi has some problems. Can you guys help me to see what is[/color]
        > going on?[color=green]
        > >
        > > i install Apache2.0.48 and Php4.3.4 in WinXP.
        > > I add some codes in httpd(inside apache group/apache2)
        > >
        > > ScriptAlias /php/ "c:/php/"
        > > AddType application/x-httpd-php .php
        > > Action application/x-httpd-php "/php/php.exe"
        > >
        > > # For PHP 4 do something like this:
        > > LoadModule php4_module "c:/php/sapi/php4apache2.dll "
        > > AddType application/x-httpd-php .php
        > >
        > > In addition, I put the php.ini file in Windows, put
        > > php4ts.dll in system32. Anything else?
        > > When I run apache and write some php code, I cannot
        > > pass agrument between two php files. Do you guys have any idea?
        > > Thanks.
        > >
        > > Krista
        > >[/color]
        >
        > page1 sends:
        >
        > www.mysite.com/page2.php?var1= "something"&var 2="somethingels e"
        >
        > page2 reads:
        >
        > $var1 = $_GET["var1"]; // or $_PUT[]
        > $var2 = $_GET["var2"]; // or $_PUT[]
        >
        > or just use $_GET[] or $_PUT[] throughout your script[/color]

        Hi ,
        I create two files.

        testing.php:

        <html>
        <head><title>te sting</title></head>
        <body>
        <form action = "testing1.p hp" method="get">
        Enter our name:
        <input type = "text" name="userName" >
        <input type ="submit" name="submit" value="Submit Now">
        </form>
        </body>
        </html>

        testing1.php:
        <html>
        <head><title>te sting1</title></head>
        <body>
        <?php
        print "Thanks $userName";
        ?>
        </body>
        </html>

        However, I cannot show the name in testing1.php. Do you guys have any idea?

        Comment

        • Doug Hutcheson

          #5
          Re: PHP and Apache confi problem

          "Krista" <ywan_ip@hotmai l.com> wrote in message
          news:eb97c972.0 312081331.1f8b6 6b9@posting.goo gle.com...[color=blue]
          > "SwissChees e" <SwissCheese@cf l.rr.com> wrote in message[/color]
          news:<airAb.306 56$%h4.12745@tw ister.tampabay. rr.com>...[color=blue][color=green]
          > > "Krista" <ywan_ip@hotmai l.com> wrote in message
          > > news:eb97c972.0 312051053.d18c5 f3@posting.goog le.com...[color=darkred]
          > > > Hi everybody,
          > > > I think my confi has some problems. Can you guys help me to see what[/color][/color][/color]
          is[color=blue][color=green]
          > > going on?[color=darkred]
          > > >
          > > > i install Apache2.0.48 and Php4.3.4 in WinXP.
          > > > I add some codes in httpd(inside apache group/apache2)
          > > >
          > > > ScriptAlias /php/ "c:/php/"
          > > > AddType application/x-httpd-php .php
          > > > Action application/x-httpd-php "/php/php.exe"
          > > >
          > > > # For PHP 4 do something like this:
          > > > LoadModule php4_module "c:/php/sapi/php4apache2.dll "
          > > > AddType application/x-httpd-php .php
          > > >
          > > > In addition, I put the php.ini file in Windows, put
          > > > php4ts.dll in system32. Anything else?
          > > > When I run apache and write some php code, I cannot
          > > > pass agrument between two php files. Do you guys have any idea?
          > > > Thanks.
          > > >
          > > > Krista
          > > >[/color]
          > >
          > > page1 sends:
          > >
          > > www.mysite.com/page2.php?var1= "something"&var 2="somethingels e"
          > >
          > > page2 reads:
          > >
          > > $var1 = $_GET["var1"]; // or $_PUT[]
          > > $var2 = $_GET["var2"]; // or $_PUT[]
          > >
          > > or just use $_GET[] or $_PUT[] throughout your script[/color]
          >
          > Hi ,
          > I create two files.
          >
          > testing.php:
          >
          > <html>
          > <head><title>te sting</title></head>
          > <body>
          > <form action = "testing1.p hp" method="get">
          > Enter our name:
          > <input type = "text" name="userName" >
          > <input type ="submit" name="submit" value="Submit Now">
          > </form>
          > </body>
          > </html>
          >
          > testing1.php:
          > <html>
          > <head><title>te sting1</title></head>
          > <body>
          > <?php
          > print "Thanks $userName";
          > ?>
          > </body>
          > </html>
          >
          > However, I cannot show the name in testing1.php. Do you guys have any[/color]
          idea?

          You have declared this to be a 'GET' operation:
          <form action = "testing1.p hp" method="get">

          So, you need to refer to the incoming variable like this:
          $HTTP_GET_VARS['id'] (Before PHP 4.1.0)
          $_GET['id'] (PHP 4.1.0 and later)
          or
          $_REQUEST['id'] (PHP 4.1.0 and later).

          In your case, that would be:
          print "Thanks " . $_GET['userName'];


          From the manual page


          Example 3.8. A simple HTML form
          <form action="foo.php " method="POST">
          Name: <input type="text" name="username" ><br>
          Email: <input type="text" name="email"><b r>
          <input type="submit" name="submit" value="Submit me!">
          </form>
          Depending on your particular setup and personal preferences, there are many
          ways to access data from your HTML forms. Some examples are:

          Example 3.9. Accessing data from a simple POST HTML form
          <?php
          // Available since PHP 4.1.0

          print $_POST['username'];
          print $_REQUEST['username'];

          import_request_ variables('p', 'p_');
          print $p_username;

          // Available since PHP 3. As of PHP 5.0.0, these long predefined
          // variables can be disabled with the register_long_a rrays directive.

          print $HTTP_POST_VARS['username'];

          // Available if the PHP directive register_global s = on. As of
          // PHP 4.2.0 the default value of register_global s = off.
          // Using/relying on this method is not preferred.

          print $username;
          ?>
          Using a GET form is similar except you'll use the appropriate GET predefined
          variable instead. GET also applies to the QUERY_STRING (the information
          after the '?' in an URL). So, for example,
          http://www.example.com/test.php?id=3 contains GET data which is accessible
          with $_GET['id']. See also $_REQUEST and import_request_ variables().



          HTH

          Doug



          Comment

          Working...