osCmax v2.5 User Manual
Results 1 to 8 of 8

Need Some help with php

This is a discussion on Need Some help with php within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Need some php help. In the code shown below how would I define friendname instead of having it being entered ...

      
  1. #1
    Member andyy15's Avatar
    Join Date
    Aug 2004
    Posts
    63
    Rep Power
    0


    Default Need Some help with php

    Need some php help.

    In the code shown below how would I define friendname instead of having it being entered as a input text field? Is there a way to do this so that the name is not shown on the actual page?
    Code:
    <?php echo tep_draw_input_field('friendname', (($friendname_error == true) ? $HTTP_POST_VARS['friendname'] : $HTTP_GET_VARS['friendname'])); if ($friendname_error == true) echo ' ' . TEXT_REQUIRED;?>
    If anyone can offer any help I would really appreciate it.

    Thanks,
    Andrew

  2. #2
    Member ddecjc's Avatar
    Join Date
    Sep 2004
    Posts
    35
    Rep Power
    0


    Default

    So are you saying that you want the value to be present in the form but not visible on the page? If so, I believe there's a function called tep_draw_hidden_field(). I'm pretty new to OSC, so I'm not sure of the details, but I'm pretty sure I've seen that in the code.

    I'm sure others will be able to jump in with more details...

  3. #3
    Member andyy15's Avatar
    Join Date
    Aug 2004
    Posts
    63
    Rep Power
    0


    Default

    Thanks for the reply ddecjc. The answer to the question you ask is yes I want the friendname value to be defined but not physically shown. If tep_draw_hidden_field() How would I incorporate that function into the above code. I do not need the error part of the code for the friendname field will be defined.
    Check out my homepage.. It\'s my jewelry website.

  4. #4
    Member ddecjc's Avatar
    Join Date
    Sep 2004
    Posts
    35
    Rep Power
    0


    Default

    Judging by the function definition (found in includes/functions/html_output.php), I would try

    Code:
    <?php echo tep_draw_hidden_field('friendname', $_REQUEST['friendname']; ?>
    I'm not sure why you're checking both $HTTP_POST_VARS and $HTTP_GET_VARS in the original code, but, by using $_REQUEST, you should catch it whether it was POST-ed or GET-ed.

  5. #5
    Member andyy15's Avatar
    Join Date
    Aug 2004
    Posts
    63
    Rep Power
    0


    Default

    Thanks again for the help.

    I am getting Parse error: parse error, unexpected ';' when I try you function. I am actually trying to modify the wishlist contribution. Instead of having it email a friend I would like the wishlist to be emailed to the store owner.
    Check out my homepage.. It\'s my jewelry website.

  6. #6
    Member ddecjc's Avatar
    Join Date
    Sep 2004
    Posts
    35
    Rep Power
    0


    Default

    Oops! I was missing a ")" at the end there. Try this:
    Code:
    <?php echo tep_draw_hidden_field('friendname', $_REQUEST['friendname']); ?>

  7. #7
    Member andyy15's Avatar
    Join Date
    Aug 2004
    Posts
    63
    Rep Power
    0


    Default

    Thanks ddecjc It actually was <?php echo tep_draw_hidden_field('friendname', $value = 'friendname'); ?> . The above function did not work for me. Thanks again for giving me the idea though.
    Check out my homepage.. It\'s my jewelry website.

  8. #8
    Member ddecjc's Avatar
    Join Date
    Sep 2004
    Posts
    35
    Rep Power
    0


    Default

    Glad you got it working!

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
  •