Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts

    sending variable across pages

    hi ,

    currently i am changing the credit card payment process for my company.

    In the old code there are 6-7 hidden variables which are across 4 checkout pages

    Now these hidden variables are being passed across the pages untill the payment has been made.

    Now is there any easy way to get those variables where needed by using sessions or any other method

    on every pages there is array like below

    PHP Code:
    $hidden[] = "<input name=\"amt\" type=\"hidden\" value=\"{$amt}\"/>\n";
        
    $hidden[] = "<input name=\"f\" type=\"hidden\" value=\"CONFIRM\"/>\n";
        
    $hidden[] = "<input name=\"userid\" type=\"hidden\" value=\"$userid\"/>\n"

    which is passed again and again across pages.


    Any other idea to make the process simple

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Sessions would be easiest. Store the data in the session when it is retrieved and then access the session on any page that you need to retrieve the data again.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    i have four pages 1,2,3,4

    It means i can put variables (from previous page) in session on page 1 e.g

    $_SESSION['userid'] = $_REQUEST['userid'];
    $_SESSION['amount'] = $_REQUEST['amt'];
    .
    ..
    .

    on page 2 i can access like

    Amount: $_SESSION['amount'];

    so i can go to page 3,4,5 and no need to declare anything on those pages , just use it
    and if i want anything extra i can put

    $_SESSION['new'] = $id;
    and on final page i can access all previous variables.


    Is this correct, because this is the payment process and i need to amke sure everything works fine

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    Yep.

    Add some debug code and print out those vars to make sure they are correct on the final processing page.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #5
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    Is it safe to put creditcard no and details in session variables?

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    No, you should never store a user's credit card details. Especially if your site is on a shared server.

  • #7
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    I am not storing Credit card information in the database but can i store CC information in session variables so that i can process across pages rather than storing in hidden variables and then POST THEM?

  • #8
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Never.

  • #9
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    the contents of $_SESSION get written to disk (with the default settings at least, this will be what's happening unless you've explicitly changed it yourself...) and on a shared server this can potentially be read by any other user of the server. On a dedicated server it's still not the best idea, better is to make the card details the very last step, such that there is no need to store them, they can passed straight off to the gateway.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #10
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    thanks for your help , i will keep these things in mind


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •