How to hide values

Discussion in 'PHP' started by Ayrshire Web Design, Sep 25, 2008.

  1. #1
    <form action="https://www.myvirtualmerchant.com/VirtualMerchant/process.do" method="POST">
    <input type="hidden" name="ssl_merchant_id" value="505413">
    <input type="hidden" name="ssl_user_id" value="632568">
    <input type="hidden" name="ssl_pin" value="XFC4AG">
    <input type="hidden" name="ssl_show_form" value="true">
    <input type="hidden" name="ssl_test_mode" value="false">
    <input type="hidden" name="ssl_invoice_number" value="0001">
    <input type="hidden" name="ssl_transaction_type" value="ccsale">
    <input type="hidden" name="ssl_description" value="<?php echo $description ?>">
    <input type="hidden" name="ssl_amount" value="<?php echo $total ?>">
    <input type="hidden" name="ssl_salestax" value="<?php echo $tax ?>">
    <input type="submit" value="Click to Order">
    </form>

    I need this to hide the first 3 values but still post to the shopping cart processor. i have tryed everything i know and just ran out of ideas. any help?

    thanks
     
    Ayrshire Web Design, Sep 25, 2008 IP
  2. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #2
    The cart processor has a bad system if those valued require hiding.
     
    live-cms_com, Sep 25, 2008 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Barti1987, Sep 25, 2008 IP
  4. Ayrshire Web Design

    Ayrshire Web Design Banned

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yea but i need to hide the 3 values in the page source without interfering with the process of posting
     
    Ayrshire Web Design, Sep 25, 2008 IP
  5. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It's impossible to truly hide them. The most you can do is use javascript to tack them onto the postdata being sent, but that doesn't hide them completely. If you want to hide them, pass the values with sessions instead of through the postdata.
     
    Shoro, Sep 25, 2008 IP
  6. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #6
    I don't quite understand, the value are already hidden. type="hidden"
     
    javaongsan, Sep 25, 2008 IP
  7. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    He wants them to not appear in "View Source".
     
    Shoro, Sep 25, 2008 IP
  8. piehead2000

    piehead2000 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Have you tried using CURL or building your own HTTP request?
     
    piehead2000, Sep 26, 2008 IP
  9. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #9
    the whole <input> including the one with type="hidden" can still be viewed at HTML Source Page. eg: when a user right click and choose View Source

    perhaps u can assign them to session variables?

    $_SESSION['things_to_hide'] = 'value_to_hide';
    PHP:
     
    ads2help, Sep 26, 2008 IP
  10. chriseccles2

    chriseccles2 Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Just a mad thought:
    -
    Perhaps you could write nifty encrypt/decrypt which is keyed
    by the user's SID ? That way, only encrypted confidential info
    would appear when the user chose to "view source" (which would
    be useless to anyone who didn't know your encrypt algorithm, even
    if they could discover the SID), and you can then decrypt using the
    static SID when the POST is returned ?
    -
    I'm fairly new to PHP, but that would seem to be do-able.

    -
    Chris
     
    chriseccles2, Sep 26, 2008 IP
  11. Ayrshire Web Design

    Ayrshire Web Design Banned

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    got an example to go along with the code insert i posted at the top

    Thanks
     
    Ayrshire Web Design, Sep 26, 2008 IP
  12. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #12
    eg: <input type="hidden" name="ssl_merchant_id" value="505413"> will be
    $_SESSION['ssl_merchant_id'] = 505413;
    PHP:
    So you have to replace the $_POST['ssl_merchant_id'] with $_SESSION['ssl_merchant_id'] in all the page. Also, make sure you call the session_start() on top of page.

    BTW I do not know if this is secure
     
    ads2help, Sep 26, 2008 IP
  13. Resco

    Resco Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #13
    That would be a good idea, you could also post the values later on using CURL post methods.
     
    Resco, Sep 27, 2008 IP