Forums

[resolved] how to add query_vars() in other folder.. (3 posts)

  1. ssong
    Member
    Posted 1 year ago #

    hi guys..
    i have a problem.
    i made some folder (url is http://example.com/test).
    and i want to use $_GET value using query_vars() this function.
    i add source

    function add_shop_var($public_query_vars) {
    $public_query_vars[] = 'product';
    return $public_query_vars;
    }

    like this.
    if i open the http://example.com/?product=1, i can get product value useing "echo intval(get_query_var('product'));".
    but inside /test/ folder, i can't.
    maybe url is problem.. but i don't know how..
    please help me!!

  2. vtxyzzy
    Member
    Posted 1 year ago #

    You don't need to create a function to set a query var. Use the built-in function set_query_var, like this:

    set_query_var('product',1);

  3. ssong
    Member
    Posted 1 year ago #

    thank you a lot^^

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags