That's actually a GET request, so $_GET['action'], instead of $_POST.

On Wed, 2003-03-19 at 11:18, Bobby Patel wrote:
    You have register_globals set to off (read up on "register globals" in
    php.net).
    your code should read
    $HTTP_POST_VARS['action'] or $_POST['action'] (depending on PHP version)
    INSTEAD of just $action.
    
    so to test an if::
    if ($HTTP_POST_VARS['action']==1) {
    /*
    Code for if action is equal to 1
    */
    }
    
    Of course checkingif the variable is set or empty might be a good idea as
    well, is set example:
    if (isset($HTTP_POST_VARS['action'])) {
    /*
    Code if the variable POSTed is set
    */
    }
    
    
    
    "Joe Kupiszewski" <[EMAIL PROTECTED]> wrote in message
    news:[EMAIL PROTECTED]
    > I think I already tried to post once, so sorry if this is a duplicate, but
    I
    > don't see my first attempt.  I am trying to do what should be a relatively
    > simple and basic task.  I've got a php script/page that has a switch/case
    > selection statement in it.  Obviously, depending on what value a
    particular
    > variable takes when passed to the script, the script SHOULD :) do
    different
    > things.  However, when I invoke the script using
    > www.somedomain.com/somephpscript.php?action=1  (substitute one with, 2, 3,
    4
    > or whatever) and then do a check whether any value is passed to my script,
    > it always tells me the value is empty ( if (empty ($action)) - it just
    > always thinks its empty.  I'm copying this script from a book, so I do not
    > have any reason to believe there is an error in the code, but obviously
    > something is not happening properly.  My thought is that perhaps something
    > needs to be turned on in the php.ini or in the apache httpd.conf file to
    > allow this variable passing to work.  Is there some other way to do this?
    >
    > Sorry for the long paragraph sentence.  I'll be happy to post the code if
    > needed or provide any additional information or give the actual URL so you
    > can see what is happening.
    >
    > Thanks for any thoughts
    >
    >
    
    
    
    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to