Professional Web Applications Themes

PHP and Apache confi problem - PHP Development

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

  1. #1

    Default 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
    Krista Guest

  2. #2

    Default Re: PHP and Apache confi problem

    "Krista" <ywan_iphotmail.com> wrote in message
    news:eb97c972.0312051053.d18c5f3posting.google.co m...
    > 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
    >
    page1 sends:

    www.mysite.com/page2.php?var1="something"&var2="somethingelse"

    page2 reads:

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

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


    SwissCheese Guest

  3. #3

    Default Re: PHP and Apache confi problem

    "SwissCheese" <SwissCheesecfl.rr.com> wrote in message news:<airAb.30656$%h4.12745twister.tampabay.rr.co m>...
    > "Krista" <ywan_iphotmail.com> wrote in message
    > news:eb97c972.0312051053.d18c5f3posting.google.co m...
    > > 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
    > >
    >
    > page1 sends:
    >
    > www.mysite.com/page2.php?var1="something"&var2="somethingelse"
    >
    > page2 reads:
    >
    > $var1 = $_GET["var1"]; // or $_PUT[]
    > $var2 = $_GET["var2"]; // or $_PUT[]
    >
    > or just use $_GET[] or $_PUT[] throughout your script
    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?
    Krista Guest

  4. #4

    Default Re: PHP and Apache confi problem

    "SwissCheese" <SwissCheesecfl.rr.com> wrote in message news:<airAb.30656$%h4.12745twister.tampabay.rr.co m>...
    > "Krista" <ywan_iphotmail.com> wrote in message
    > news:eb97c972.0312051053.d18c5f3posting.google.co m...
    > > 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
    > >
    >
    > page1 sends:
    >
    > www.mysite.com/page2.php?var1="something"&var2="somethingelse"
    >
    > page2 reads:
    >
    > $var1 = $_GET["var1"]; // or $_PUT[]
    > $var2 = $_GET["var2"]; // or $_PUT[]
    >
    > or just use $_GET[] or $_PUT[] throughout your script
    Hi ,
    I create two files.

    testing.php:

    <html>
    <head><title>testing</title></head>
    <body>
    <form action = "testing1.php" 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>testing1</title></head>
    <body>
    <?php
    print "Thanks $userName";
    ?>
    </body>
    </html>

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

  5. #5

    Default Re: PHP and Apache confi problem

    "Krista" <ywan_iphotmail.com> wrote in message
    news:eb97c972.0312081331.1f8b66b9posting.google.c om...
    > "SwissCheese" <SwissCheesecfl.rr.com> wrote in message
    news:<airAb.30656$%h4.12745twister.tampabay.rr.co m>...
    > > "Krista" <ywan_iphotmail.com> wrote in message
    > > news:eb97c972.0312051053.d18c5f3posting.google.co m...
    > > > 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
    > > >
    > >
    > > page1 sends:
    > >
    > > www.mysite.com/page2.php?var1="something"&var2="somethingelse"
    > >
    > > page2 reads:
    > >
    > > $var1 = $_GET["var1"]; // or $_PUT[]
    > > $var2 = $_GET["var2"]; // or $_PUT[]
    > >
    > > or just use $_GET[] or $_PUT[] throughout your script
    >
    > Hi ,
    > I create two files.
    >
    > testing.php:
    >
    > <html>
    > <head><title>testing</title></head>
    > <body>
    > <form action = "testing1.php" 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>testing1</title></head>
    > <body>
    > <?php
    > print "Thanks $userName";
    > ?>
    > </body>
    > </html>
    >
    > However, I cannot show the name in testing1.php. Do you guys have any
    idea?

    You have declared this to be a 'GET' operation:
    <form action = "testing1.php" 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
    [url]http://www.php.net/manual/en/language.variables.external.php:[/url]

    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"><br>
    <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_arrays directive.

    print $HTTP_POST_VARS['username'];

    // Available if the PHP directive register_globals = on. As of
    // PHP 4.2.0 the default value of register_globals = 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,
    [url]http://www.example.com/test.php?id=3[/url] contains GET data which is accessible
    with $_GET['id']. See also $_REQUEST and import_request_variables().



    HTH

    Doug



    Doug Hutcheson 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. Problem with Apache 1.3.28/PHP 4.3.3 on XP
    By Nick Rees in forum PHP Development
    Replies: 2
    Last Post: September 15th, 03:05 AM
  3. Replies: 2
    Last Post: July 27th, 05:29 PM
  4. Replies: 2
    Last Post: July 17th, 07:27 AM
  5. Apache/php/postgres problem
    By Mcptron in forum AIX
    Replies: 0
    Last Post: June 28th, 05:02 PM

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