Professional Web Applications Themes

HTTP_POST and HTTP_GET_VARS - PHP Development

I am a beggining PHP developer (been doing it for like 3 weeks now) and I am currently having a problem getting these arrays to work. I am running PHP 4.3.4 with Apache 2.0.47 on WinXP. I have a pretty good idea as to how they work, but no clue on how to apply them to the PHP scripts that I have written. (I'm not sure how to code it in properly, and have been stuck on this problem for a few days now) Could some one please advise me on this matter? (preferably soon?!?) Due to the differences I ...

  1. #1

    Default HTTP_POST and HTTP_GET_VARS

    I am a beggining PHP developer (been doing it for like 3 weeks now)
    and I am currently having a problem getting these arrays to work. I am
    running PHP 4.3.4 with Apache 2.0.47 on WinXP. I have a pretty good
    idea as to how they work, but no clue on how to apply them to the PHP
    scripts that I have written. (I'm not sure how to code it in properly,
    and have been stuck on this problem for a few days now) Could some one
    please advise me on this matter? (preferably soon?!?) Due to the
    differences I have spotted amongst the versions of PHP out there, I am
    not sure what the format is for the code.
    ~Greatful for any help!
    ~Phry
    Phrylock Guest

  2. #2

    Default Re: HTTP_POST and HTTP_GET_VARS

    Phrylock wrote:
    > I am a beggining PHP developer (been doing it for like 3 weeks now)
    > and I am currently having a problem getting these arrays to work. I am
    > running PHP 4.3.4 with Apache 2.0.47 on WinXP.
    [snip]

    The manual is your first stop:

    <URL:http://www.php.net/manual/en/reserved.variables.php>
    <URL:http://www.php.net/manual/en/language.variables.predefined.php>

    Basically, $HTTP_POST_VARS[] is just a normal array that is initially
    populated by PHP, and $_POST[] is a "superglobal". Don't bother using
    $HTTP_POST_VARS[] unless you absolutely have to use an old version of PHP
    or something. The same applies to the other predefined arrays such as
    $_GET[] and $HTTP_GET_VARS[].

    For example:

    <?php

    echo(htmlentities($_REQUEST['foo']));

    ?>


    --
    Jim Dabell

    Jim Dabell Guest

  3. #3

    Default Re: HTTP_POST and HTTP_GET_VARS

    So, let say I have an HTML page with drop menus, text boxes, and a
    submit button. 1 menu is for selecting a species of wood (6 types for
    my purposes), thus 6 options and the variable is known as Species, the
    next menu is size, and there are 24 options there (variable name =
    size), then the next thing is a text box for quantity to order,
    numeric, (variable = qty), then finally the user has to select a state
    to add the corresponding state taxes, (Variable= State), how do I get
    these variables to be read in PHP 4.3.4 then, without using the affor
    mentioned Array methods?

    Thanks,
    Andy

    Jim Dabell <jim-usenetjimdabell.com> wrote in message news:<fPadnYUQZOMSJzaiRVn-tggiganews.com>...
    > Phrylock wrote:
    >
    > > I am a beggining PHP developer (been doing it for like 3 weeks now)
    > > and I am currently having a problem getting these arrays to work. I am
    > > running PHP 4.3.4 with Apache 2.0.47 on WinXP.
    > [snip]
    >
    > The manual is your first stop:
    >
    > <URL:http://www.php.net/manual/en/reserved.variables.php>
    > <URL:http://www.php.net/manual/en/language.variables.predefined.php>
    >
    > Basically, $HTTP_POST_VARS[] is just a normal array that is initially
    > populated by PHP, and $_POST[] is a "superglobal". Don't bother using
    > $HTTP_POST_VARS[] unless you absolutely have to use an old version of PHP
    > or something. The same applies to the other predefined arrays such as
    > $_GET[] and $HTTP_GET_VARS[].
    >
    > For example:
    >
    > <?php
    >
    > echo(htmlentities($_REQUEST['foo']));
    >
    > ?>
    Phrylock Guest

  4. #4

    Default Re: HTTP_POST and HTTP_GET_VARS


    [Please don't post upside-down]

    Phrylock wrote:
    > Jim Dabell <jim-usenetjimdabell.com> wrote in message
    > news:<fPadnYUQZOMSJzaiRVn-tggiganews.com>...
    [snip]
    >> Basically, $HTTP_POST_VARS[] is just a normal array that is initially
    >> populated by PHP, and $_POST[] is a "superglobal". Don't bother using
    >> $HTTP_POST_VARS[] unless you absolutely have to use an old version of PHP
    >> or something. The same applies to the other predefined arrays such as
    >> $_GET[] and $HTTP_GET_VARS[].
    [snip]
    > So, let say I have an HTML page with drop menus, text boxes, and a
    > submit button. 1 menu is for selecting a species of wood (6 types for
    > my purposes), thus 6 options and the variable is known as Species, the
    > next menu is size, and there are 24 options there (variable name =
    > size), then the next thing is a text box for quantity to order,
    > numeric, (variable = qty), then finally the user has to select a state
    > to add the corresponding state taxes, (Variable= State), how do I get
    > these variables to be read in PHP 4.3.4 then, without using the affor
    > mentioned Array methods?
    Use the $_REQUEST[] like I showed you in the example. It's just an array
    you can access from anywhere in your scripts. It is populated by PHP
    automatically, you don't have to worry about getting the values into the
    array, you just have to use it. For instance:

    index.html:

    [...]
    <form action="process.php" method="post">
    <input type="text" name="qty">
    <input type="submit">
    </form>
    [...]

    process.php:

    [...]
    <?php

    echo('You ordered ' . htmlentities($_REQUEST['qty']) . ' items.');

    ?>
    [...]

    --
    Jim Dabell

    Jim Dabell Guest

  5. #5

    Default Re: HTTP_POST and HTTP_GET_VARS

    Jim Dabell <jim-usenetjimdabell.com> wrote in message news:<DPSdnQpineORdzaiRVn-hQgiganews.com>...
    > [Please don't post upside-down]
    >
    > Phrylock wrote:
    > > Jim Dabell <jim-usenetjimdabell.com> wrote in message
    > > news:<fPadnYUQZOMSJzaiRVn-tggiganews.com>...
    > [snip]
    > >> Basically, $HTTP_POST_VARS[] is just a normal array that is initially
    > >> populated by PHP, and $_POST[] is a "superglobal". Don't bother using
    > >> $HTTP_POST_VARS[] unless you absolutely have to use an old version of PHP
    > >> or something. The same applies to the other predefined arrays such as
    > >> $_GET[] and $HTTP_GET_VARS[].
    > [snip]
    > > So, let say I have an HTML page with drop menus, text boxes, and a
    > > submit button. 1 menu is for selecting a species of wood (6 types for
    > > my purposes), thus 6 options and the variable is known as Species, the
    > > next menu is size, and there are 24 options there (variable name =
    > > size), then the next thing is a text box for quantity to order,
    > > numeric, (variable = qty), then finally the user has to select a state
    > > to add the corresponding state taxes, (Variable= State), how do I get
    > > these variables to be read in PHP 4.3.4 then, without using the affor
    > > mentioned Array methods?
    >
    > Use the $_REQUEST[] like I showed you in the example. It's just an array
    > you can access from anywhere in your scripts. It is populated by PHP
    > automatically, you don't have to worry about getting the values into the
    > array, you just have to use it. For instance:
    >
    > index.html:
    >
    > [...]
    > <form action="process.php" method="post">
    > <input type="text" name="qty">
    > <input type="submit">
    > </form>
    > [...]
    >
    > process.php:
    >
    > [...]
    > <?php
    >
    > echo('You ordered ' . htmlentities($_REQUEST['qty']) . ' items.');
    >
    > ?>
    > [...]
    Thanks Man! I will try this first thing monday morning. Hopefully it
    leads me somewhere, will keep you posted!
    Phrylock Guest

  6. #6

    Default Re: HTTP_POST and HTTP_GET_VARS

    Hey,
    Good news! I finally got it to work, and work well for me... Thanks
    for all your help.

    ~Phry

    [email]nothingnorwaymi.com[/email] (Phrylock) wrote in message news:<dca563c0.0311071409.7b8cdad1posting.google. com>...
    > Jim Dabell <jim-usenetjimdabell.com> wrote in message news:<DPSdnQpineORdzaiRVn-hQgiganews.com>...
    > > [Please don't post upside-down]
    > >
    > > Phrylock wrote:
    > > > Jim Dabell <jim-usenetjimdabell.com> wrote in message
    > > > news:<fPadnYUQZOMSJzaiRVn-tggiganews.com>...
    > [snip]
    > > >> Basically, $HTTP_POST_VARS[] is just a normal array that is initially
    > > >> populated by PHP, and $_POST[] is a "superglobal". Don't bother using
    > > >> $HTTP_POST_VARS[] unless you absolutely have to use an old version of PHP
    > > >> or something. The same applies to the other predefined arrays such as
    > > >> $_GET[] and $HTTP_GET_VARS[].
    > [snip]
    > > > So, let say I have an HTML page with drop menus, text boxes, and a
    > > > submit button. 1 menu is for selecting a species of wood (6 types for
    > > > my purposes), thus 6 options and the variable is known as Species, the
    > > > next menu is size, and there are 24 options there (variable name =
    > > > size), then the next thing is a text box for quantity to order,
    > > > numeric, (variable = qty), then finally the user has to select a state
    > > > to add the corresponding state taxes, (Variable= State), how do I get
    > > > these variables to be read in PHP 4.3.4 then, without using the affor
    > > > mentioned Array methods?
    > >
    > > Use the $_REQUEST[] like I showed you in the example. It's just an array
    > > you can access from anywhere in your scripts. It is populated by PHP
    > > automatically, you don't have to worry about getting the values into the
    > > array, you just have to use it. For instance:
    > >
    > > index.html:
    > >
    > > [...]
    > > <form action="process.php" method="post">
    > > <input type="text" name="qty">
    > > <input type="submit">
    > > </form>
    > > [...]
    > >
    > > process.php:
    > >
    > > [...]
    > > <?php
    > >
    > > echo('You ordered ' . htmlentities($_REQUEST['qty']) . ' items.');
    > >
    > > ?>
    > > [...]
    >
    > Thanks Man! I will try this first thing monday morning. Hopefully it
    > leads me somewhere, will keep you posted!
    Phrylock Guest

Similar Threads

  1. #14288 [Com]: HTTP_GET_VARS influenced by PHP_SELF
    By christopherbrueck at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: November 17th, 08:14 AM
  2. $_GET vs $HTTP_GET_VARS
    By Jez in forum PHP Development
    Replies: 2
    Last Post: October 15th, 07:03 PM
  3. #25407 [Opn->Bgs]: $HTTP_GET_VARS and $HTTP_POST_VARS
    By pollita@php.net in forum PHP Development
    Replies: 0
    Last Post: September 7th, 03:18 AM
  4. #25407 [NEW]: $HTTP_GET_VARS and $HTTP_POST_VARS
    By louison dot raymond at libertysurf dot fr in forum PHP Development
    Replies: 0
    Last Post: September 7th, 03:00 AM
  5. Accessing $HTTP_GET_VARS in classes..?
    By Ben Hall in forum PHP Development
    Replies: 2
    Last Post: July 20th, 07:11 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