SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get and store rather than echo??!?

    Hi there,

    I need data from a MySQL database. But not display it.

    I am trying to store some information before it is displayed.

    I know how to display variables (ie. do a MySQL query and then echo the variables).

    But how do I store the value on the page? Some I do not want to display (it is for a basket and I do not not want to display the customer email address but I do need to pass it to the card processing company).

    So how do I just get, store or save the variable on the page rather than echo it?

    Hope you know the answer!

    Matt.

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    ... put it in a variable instead of echoing it?

  3. #3
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    If it's on the page, you're echoing it... the only way to send information to the page is as content in the html... if it's not something that should be sent client side, you shouldn't be passing it in the page.

    Well, there are cookies and sessions -- I'd not use the former for something like a credit card number as that's passed in the clear -- session data isn't passed client side, just the hash to tell the server what session it is... so that's better.

    Really though, it sounds like you're either overthinking things or sending information client side that has no business client-side.

  4. #4
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well - if a customer has just entered their email address when they get to the next page it will store it in the MySQL table, I DO NOT want to display it. But I do need to pass it to the card processing company. So I need to save/request it but not echo it. I need to request it from the MySQL Database. But I do not want to display it.

    Matt.

  5. #5
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Huh? That doesn't make ANY sense...

    I have a silly question, how does the credit card company in question say they want to receive it? I'd assume either as getData, postData, or as content in the request...

  6. #6
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,081
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Sounds to me like you should put it in a hidden form field, but it depends on how the card processing company accepts payment requests from you.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  7. #7
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well a page on our server asks for the customers name, email, address, telephone number, etc.

    Then on the next page (again on our server) it will save the data to a MySQL table!

    Then on the next page it will GO TO THE PAYMENT COMPANY'S SERVER and they want all the info from us (name, email, address, telephone number, etc.) I do not want to display this information BUT I NEED TO SEND IT TO THEM - I plan to request the info but not display it - then i can send it to the processing company!

    Our old basket used to be coded like this:

    PHP Code:
    $ThisDescription="Online order from ActiveGPS.co.uk";
    $ThisCustomerEmail$_REQUEST['CustomerEmail'];
    $ThisCustomerName$_REQUEST['CustomerTitle']." ".$_REQUEST['CustomerName'];
    $ThisDeliveryAddress$_REQUEST['DeliveryAddress'];
    $ThisDeliveryPostCode$_REQUEST['DeliveryPostCode'];
    $ThisBillingAddress$_REQUEST['DeliveryAddress'];
    $ThisBillingPostCode$_REQUEST['DeliveryPostCode'];
    // new 2.22 fields
    $ThisContactNumber $_REQUEST'ContactNumber' ];
    $ThisAllowGiftAid $_REQUEST'AllowGiftAid' ];
    $ThisApplyAVSCV2 $_REQUEST'ApplyAVSCV2' ];
    $ThisApply3DSecure $_REQUEST'Apply3DSecure' ]; 
    This does not use a MySQL database. I need to do the same but NOW I AM USING A MYSQL database!

    Do you understand?!

    Matt.

  8. #8
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    How do THEY want to receive that information remains the question! You're still not saying that... There's only three ways of passing data -- one of which stuffs it in the URL, one involves faking a form request and the third being to send them output... which means echo and/or it's equivalents -- that markup would NOT be sent to the client and SHOULD be sent via HTTPS.

  9. #9
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh - ok - now I understand what you need --- the basket uses stuff code like this:

    PHP Code:
    $stuff "VendorTxCode=" $ThisVendorTxCode "&";
    $stuff .= "Amount=" $ThisAmount "&";
    $stuff .= "Currency=" $ThisCurrency "&";
    $stuff .= "Description=" $ThisDescription "&";
    $stuff .= "SuccessURL=" $MyServer "completed.php&";
    $stuff .= "FailureURL=" $MyServer "notcompleted.php&";

    if (
    $ThisCustomerEmail) {
      
    $stuff .= "CustomerEmail=" $ThisCustomerEmail "&";
    }
    if (
    $ThisCustomerName) {
      
    $stuff .= "CustomerName=" $ThisCustomerName "&";
    }
    if (
    $ThisDeliveryAddress) {
      
    $stuff .= "DeliveryAddress=" $ThisDeliveryAddress "&";
    }
    if (
    $ThisDeliveryPostCode) {
      
    $stuff .= "DeliveryPostCode=" $ThisDeliveryPostCode "&";
    }
    if (
    $ThisBillingAddress) {
      
    $stuff .= "BillingAddress=" $ThisDeliveryAddress "&";
    }
    if (
    $ThisBillingPostCode) {
      
    $stuff .= "BillingPostCode=" $ThisDeliveryPostCode "&";
    }
    // new 2.22 fields
    if ($ThisContactNumber) {
      
    $stuff .= "ContactNumber=" $ThisContactNumber "&";
    }


        
    $stuff .= "ApplyAVSCV2=" $ThisApplyAVSCV2 "&";
        
    $stuff .= "Apply3DSecure=" $ThisApply3DSecure "&";
        
    $stuff .= "eMailMessage=Thankyou for your order from activegps.co.uk, we will dispatch your goods shortly&";
        
    $stuff .= "Basket=$pdBasket"
    If this cannot be done WITHOUT JAVASCRIPT I will NOT use this method!! So let me know this too, please!

    Obviously, I need to get the info - and it is not all displayed (hence my question above).
    Thanks,

    Matt


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
  •