re-post $HTTP_POST_VARS

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

    #1

    re-post $HTTP_POST_VARS

    the code is used for repost $HTTP_POST_VARS from a form to the insert
    page at the "preview" page

    <?php
    /* Re-Post all POST'ed variables */
    reset($HTTP_POS T_VARS);
    while (list($key, $value) = each($HTTP_POST _VARS)) {
    if (!is_array($HTT P_POST_VARS[$key])) {
    echo tep_draw_hidden _field($key,
    htmlspecialchar s(stripslashes( $value)));
    }
    ---------------------------------------------
    the above part excuting well then error occurs with the following code
    which is used to check if the $HTTP_POST_VARS is an array

    if (is_array($HTTP _POST_VARS[$key]) ) {


    $ar = $HTTP_POST_VARS[$key];
    foreach ($ar as $re)
    {
    echo tep_draw_hidden _field($key.'[]', $re);
    }
    }

    }

    the code is able to excute but warning message appear:
    Warning: Unexpected character in input: '' (ASCII=29) state=1 in
    /home/frey80/public_html/catalog/admin/categories.php on line 863

    Warning: session_start() : Cannot send session cache limiter - headers
    already sent (output started at
    /home/frey80/public_html/catalog/admin/categories.php: 863) in
    /home/frey80/public_html/catalog/admin/includes/functions/sessions.php
    on line 67

    i suspect the second part of re-post script cause the session info to
    be send again, my intention was to choose the value from a multiple
    select box which comes as an array and re-post it, is there any idea
    what i can do?

    thank you very much!!

  • Mike Willbanks

    #2
    Re: re-post $HTTP_POST_VARS

    frey,
    [color=blue]
    > <?php
    > /* Re-Post all POST'ed variables */
    > reset($HTTP_POS T_VARS);
    > while (list($key, $value) = each($HTTP_POST _VARS)) {
    > if (!is_array($HTT P_POST_VARS[$key])) {
    > echo tep_draw_hidden _field($key,
    > htmlspecialchar s(stripslashes( $value)));
    > }
    > ---------------------------------------------
    > the above part excuting well then error occurs with the following code
    > which is used to check if the $HTTP_POST_VARS is an array
    >
    > if (is_array($HTTP _POST_VARS[$key]) ) {
    >
    >
    > $ar = $HTTP_POST_VARS[$key];
    > foreach ($ar as $re)
    > {
    > echo tep_draw_hidden _field($key.'[]', $re);
    > }
    > }
    >
    > }[/color]

    If you could repost that snip of code with the line numbers and the
    tep_draw_hidden _field code that may help. Also $HTTP_POST_VARS , why
    would you use that? $_POST would be more accurate.

    Mike

    Comment

    Working...